Hi I am trying to use oData expand in a vizFrame(pie chart).
My entitySet for the Chart is grouped by their, ... well group.
But the entitySet only has the key of the group, the text and other data are in an associated entitySet.
I tried to use expand just I would use it in tables:
viz.data:FlattenedDataset data="{
path: 'odataModel>myEntitySet',
parameters: {
expand: 'toAssoc'
}
}">
....
<viz.data:dimensions>
<viz.data:DimensionDefinition name="Matrialgruppe"
value="{odataModel>toAssoc/myText}" />
</viz.data:dimensions>
It does not work.
I dont get any error in the consol, but where the chart should be I get the text:
SyntaxError: Unexpected token u in JSON at position 0
How can I make expand work for VizFrames?
Related
I am currently working on ASP.Net MVC project. I am using Vuejs- Axios to get out data from entity data models. So...axios.get (gets the API) and now I am displaying my chart based on the value received.I am also on the same page showing table of data(same api results). The table has a search box, as user enter details to search a particular product my chart should show respective data. The problem is : I am in my javascript for table data: created api request , computed and used method(for filtering data). Now in the same filter method...when I do console.log(response.length)...I get correct filtered records....but when I write response.data….I get msg as undefined...
Kindly let a beginner like me know...how I can use this filtered data to create new chart...
If the filtered data can show correct length...it should be able to show data as well..
Thanks.
Edited: code here...
Javascript for chart( Vue-Chartjs):
var app = new Vue({
el:"#abc"
data:{
chart:null,
loading:false
},
created function(){
this.loading = true
axios.get('api/Work')
.then (function(response){
console.log(response.data)
calculated fields required.....
var ctx= document.getElementById("chart1")
chart....labels, datasets..etc....
Javascript - Loading table)
var app = new Vue({
el:"#abcd",
data(){
return:
fields:[
]},
created function(){
axios.get('api/Work')
.then (function(response){
console.log(response.data)
},
computed:{
mounted(){
this.totalrows= this.totalrows.length
}
},
methods:{
onfiltered(filteritems){
console.log(filteritems.length) =====returns correct table search - i.e filtered table length.....
console.log(filteritems.data)
=====returns undefined...........Stuck up here......
Once I get the filtered data , I can make the new chart based on the filtered values. So this is the place where I need clarifications.
Thanks.
According to the document, I can list the Office 365 Groups by using the following Graph API:
GET https://graph.microsoft.com/v1.0/groups
I have a C# Web application, and there is a input for searching by the Group DisplayName. Any idea how to query groups based on the DisplayName?
I have tried the following URL: https://graph.microsoft.com/v1.0/groups?$search="displayName:Test" in the MS Graph Explorer which didn't work.
I get the following error.
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "This query is not supported.",
"innerError": {
"request-id": "35d90412-03f3-44e7-a7a4-d33cee155101",
"date": "2018-10-25T05:32:53"
}
}
Any suggestion is welcomed.
Thanks in advance.
According to your description, I assume you want to search the Group by the DisplayName using the search parameters.
Based on this document, we can currently search only message and person collections. So we couldn't use the search parameter.
We can use the filter query parameter to search the Group by DisplayName. For example, we can search the groups whose displayName is start with 'Test',the request url like this:
https://graph.microsoft.com/v1.0/groups?$filter=startswith(displayName,'Test')
Here is C# code that I wrote to get a group using the DisplayName. This code requires a reference to the OfficeDevPnP.Core.
private static async Task<Group> GetGroupByName(string accessToken, string groupName)
{
var graphClient = GraphUtility.CreateGraphClient(accessToken);
var targetGroupCollection = await graphClient.Groups.Request()
.Filter($"startsWith(displayName,'{groupName}')")
.GetAsync();
var targetGroup = targetGroupCollection.ToList().Where(g => g.DisplayName == groupName).FirstOrDefault();
if (targetGroup != null)
return targetGroup;
return null;
}
UPDATE
I see that the answer has already been accepted, but I came across the same issue and found that this answer is out of date. For the next person, this is the update:
The 'search' functionality does work. Whether it was fixed along the way or always has, I am not sure.
'groups' support search,
both the v1 and beta api support search,
search only works on 'displayName' and 'description' fields,
searching on 'directory objects' require a special header: 'ConsistencyLevel: eventual'
Point number 4 is what tripped me up!
Your request would look like this:
https://graph.microsoft.com/v1.0/groups?$search="displayName:Test"
With the request header:
ConsistencyLevel: eventual
There is another catch: You can only specify the first 21 characters and the search always uses 'startsWith'. You're out of luck if you specify more than that: The search always fails.
Current Ui5 Version used 1.46.12
Using: sap.ui.model.odata.v4.ODataModel
What is Required?
Is to Fetch the first item's value "EventDate" of the list array which is received from the oData(v4) response.
View Code
<layout:VerticalLayout binding="{/Logs}">
<Text text="Latest update"/>
<Text id="LastUpdatedSynchronizeDateStringText"
text="{EventDate}"/>
</layout>
Batch request response (oData v4)
{
"#odata.context":"http://localhost/odata/$metadata#Logs","value":[
{
"LogId":12512,"ErrText":"end","EventDate":"2017-05-11T07:10:44Z","Location":"OEN","Result":0
}
]
}
Tried & Failed:
<Text id="Last..." text="{EventDate}"/>
<Text id="Last..." text="{0/EventDate}"/>
<Text id="Last..." text="{0.EventDate}"/>
Error message is "Failed to drill down"
Setting "binding" property to the collection path makes no sense, bacause it will set the binding context to the VerticalLayout control that you cannot access due to array (collection) nature. If it was the direct link to a specific object (with its keys), then it would work.
In your case, you can perform the request to '/Logs' collection via coding and in "success" method of "read" function bind the VerticalLayout to the retrieved object, then the 'text="{EventData}"' will work.
Rough steps:
odatamodel.read
handle success method
via odatamodel.createKey method construct the key to the first object
call "verticalLayout.bindObject" passing the constructed key before
the Text control will automatically get an update due to context change of the parent control and you will see your date
I have a simple Cassandra KF:
create table messages (
id varchar,
headers map<varchar, varchar>,
primary key (id));
The table gets an auto-generated Solr index. The values of the headers field will be around what you expect in email headers. I can see that Solr generates the following line for the headers:
<dynamicField indexed="true" multiValued="false" name="headers*" stored="true" type="TextField"/>
However, I can't see to find anything in the headers, nor get their values using Solr API. A record:
cassandra#cqlsh:tpb> SELECT id, headers FROM messages;
1492cc10-046d-11e6-a332-55ae2575ea1a | {'component-count': '1', 'component-type-0': 'Document-Upload', 'consumer-behalf': 'true', 'date': 'Sun Apr 17 2016 00:22:02 GMT-0700 (PDT)', 'from': '718bcc80-9def-11e5-a837-0800200c9a66#1a4de124-5761-4668-9e9d-a880aa4e6dd1', 'message-id': '1492cc10-046d-11e6-a332-55ae2575ea1a#32d2a682-af07-4108-a15a-de6f8a75e811', 'to': '"mark-watney#cool-dude"#32d2a682-af07-4108-a15a-de6f8a75e811', 'transaction-id': '14585b20-046d-11e6-a332-55ae2575ea1a'}
Running these two queries don't ever return me any header values (note that any URL encoding is reversed for readability):
...select?q=id:1492cc10-046d-11e6-a332-55ae2575ea1a&fl=id,headersconsumer-behalf&wt=json&indent=true
...select?q=id:1492cc10-046d-11e6-a332-55ae2575ea1a&fl=id,headers*&wt=json&indent=true
Searching by header value seems to yield no results either, e.g.
...select?q=headersdate:Sun&fl=id&wt=json&indent=true
...select?q=headersconsumer-behalf:true&fl=id&wt=json&indent=true
both return empty sets (but should match the above document).
It feels like I'm missing something, but I can't figure out what. Solr admin reports "headers*" field to exist, and be properly indexed and what not.
So, the question: how can I return and search by dynamic fields (inferred from a Cassandra map) in DSE?
The keys in your CQL map need to be prepended with the dynamic field name:
1492cc10-046d-11e6-a332-55ae2575ea1a | {'headerscount': '1', 'headerstype-0': 'Document-Upload',...
or
1492cc10-046d-11e6-a332-55ae2575ea1a | {'headerscomponent-count': '1', 'headerscomponent-type-0': 'Document-Upload',...
It is recommended that the map name in CQL has the form '_' so that your dynamic fields then look like: 'headers_component-type-0'.
This is the base schema of oData EDM:
thanks for the image Filippo
I have my db structure:
Product (Code, Description, IVA, Price)
|n
|
|
|
|1
Purchase(ID, Product, Customer)
I want expose my data using oData; I can map in a natural way Product and Purchase in two EntitySet: ProductSet and PurchaseSet.
If I require for example all items of ProductSet I receive a collection of 100 products; each product have 4 properties, for example:
{
Code:01,
Description: "blue pen",
IVA: "19",
Price: "2.99"
}
Ok but based on the user logged, the business logic before oData want send me more information (for example the editable sub property):
{
Code: {value:01, editable:false},
Description: {value:"blue pen", editable:false},
IVA: {value:19, editable:true},
Price: {value:"2.99", editable:true}
}
(I can't sent the new information in this mode, I have only entity sets and properties...)
What is the right way to map editable infos in EDM? A New Property??
You can achieve this by creating a ComplexType that will have the properties of value and editable. So the properties of your Entity will refer to the ComplexType.