Googlechart error on a linechart with tooltip values coming via JSON - json

I have a google chart and want to add a custom tooltip. I found some great answers like this this site and set about doing this with roles. I also found this link about it and it looked like the best way.
My data is being generated via json and I use a php file to create a json feed. The rows I have coded like this
{"cols": [ {"id":"","label":"Period","pattern":""},
{"id":"","label":"Recorded P/L","type":"number", "role":"data"} ,
{"id":"","label": null,"type":"string", "role":"tooltip"},
{"id":"","label":"Best Available P/L","type":"number", "role":"data"},
{"id":"","label": null,"type":"string", "role":"tooltip"}
]
Then it goes on and adds all the data. The problem is when I try to run this I get the error
All series on a given axis must be of the same data type
I have checked the json and that is formed correctly but am not sure what I could be doing wrong.

At least part of your problem is that you're not specifying the type for your first column.

Related

SharePoint autogenerated JSON formatting and use of operator or field choice not working

I did a search on this topic and I am not that JSON familiar, so I thought I'd see if I can find the answer here to my question from the community.
I have a view from a list that I am formatting in SharePoint (SP) that creates some automated JSON. It simply colors the items based on if the value matches in the generated JSON code. I am trying to tweak it but having trouble getting the format to come up as a match.
I am trying to use just the one column called Display. It's a calculated field which concatenates a bunch of string text.
Here is what the generated section of code from SP I am trying to tweak looks like (this is not all of it):
{ "operator": "==",
"operands": [
"[$Display]",
"LOCATED"
]
}, =if(#isSelected == "true" etc...
So the formatting will happen if the data in field Display = LOCATED returning true and will apply the formatting. What I am trying to do, is get some sort of string contains or wild card matching.
The contents of the field Display in the SP list will contain something dynamic and possibly the word LOCATED somewhere in the text.
So ideally I'd like to tweak this code to return true for the formatting if the Display field content said something like "John Doe LOCATED New York" for example.
if anyone has any ideas how I could solve this that would be great. Also I was trying another field which is a choice field for exact matching but I couldn't get it to work either.
Thanks.
This issue has been resolved, by doing an exact field match instead of wildcarding.

Hide JsonValue from log file using <flter-spec>

I'am trying to hide the Json value of the student field from log files using filter-spec,
this is my filter-spec :
after i applied the flter this is how the data is showing in the log file
all i want it is to replace ("student" : "testStudent") with ("student": "****") instead it is got replaced with ("student: ****)
does anyone have an example on how to hide the json value using filter-spec?
Thanks in advance
It is not actually possible replace a JSON value with a filter. You'd need to use a custom filter or custom handler in order to do this.
You could file a feature request though. It does seem like a decent idea for a filter to be able to filter values in structured formats.

How to display returned data json to grid in firemonkey?

I have received data from json web service with RESTRequest component
but I do not know how I should display the returned data in a grid?
How can I use RESTResponseDataSetAdapter to improve this?
Try this - it took me about 15 minutes to get working
Open the RESTDemos in your Delphi install's Samples\Object Pascal\Database\RESTDemo
Drop a TStringGrid on the RHS of the the Delphi-Praxis tab (I chose this one because
the URI on the Fetch to DataSet produces a 404 error).
If necessary, make the non-visual controls on the form visible.
Dbl-click BindingList and use the QuickBindings to add a LinkGridToDataSource. Set its
DataSource to ClientDataSet and its GridControl to StringGrid1. Thus will cause DBSourceDB1 to be created'.
Set the Response property of RestReponseDataSetAdaptor to `RESTResponse'.
Compile, run and click the fetch list of forums button. You should see the StringGrid populates
from the contents of memo_ResponseData
That should show you that LiveBindings can work with a RESTReponse to populate a grid. The RESTDemos demo has a lot more things in it, but if this is your first experience of LiveBindings, you might want to backtrack and try setting up a simple test project which populates a TStringGrid and a few TEdits from a dataset of your own.

Power BI and JSON data

Is it possible to make Power BI read JSON data? I've spent an entire day yesterday to figure out how to convert the JSON data into a readable table in Power Bi, but with no luck.
I tried googling for hours, but there is no proper documentation anywhere.
I'm retrieving a JSON payload from my website and when I try to import, it shows the data like this:
Record
Record
Record
Record
Maybe there are any tutorials I can follow? Or perhaps another alternative to Power BI that would properly read and structure my JSON data?
As mentioned in comments, just besides each Record (if headers), are you able to see any small box with two arrows, try clicking it.
This Answer may help now..
First We have to convert this to table ->Click on the Icon in top left corner
Properties window will open. dont change anything Click on Ok.Now you can see the list converted to Column.
There is an arrow icon in the column -> Click on it
Main Step :In the property window uncheck "use original column name as prefix"
Here we go You can now use this result !
Refer Below Links :
https://www.mssqltips.com/sqlservertip/4621/using-power-bi-with-json-data-sources-and-files/
https://www.dutchdatadude.com/loading-multiple-json-files-using-power-query/
Retrieving data from a .json file brings in 'Records'. Each row of data is returned as a 'Record' which is a List. Each record in 'Records' is a hyperlink that opens the row elements. You could convert the 'Records' into a table, but you get a Table with a single column which has all the records with each record a row from the original JSON data.
Here is a link to few more details:
http://hodentekmsss.blogspot.com/2016/11/retrieving-json-data-in-power-bi.html

Test.loadData with Custom sObject Throws Exception

I am loading a CSV file via Static Resourced to test my APEX code. I am using the following code in my test:
List<Territory_Zip_Code__c> territoryData = Test.loadData(Territory_Zip_Code__c.sObjectType, TERRITORY_ZIP_CODES_STATIC_RESOURCE_NAME);
The first few lines of the CSV file look like so:
Territory__c,Zip_Code__c
ABC,123
DEF,456
I am getting the following error:
System.StringException: Unknown field: Territory__c
Territory__c is a valid API field name for my custom sObject.
I've also tried adding the sObject name in front of the field name, like My_Territory__c.Territory__c but that didn't work either.
In addition, I tried using the field name, instead of the API name (for example, Territory) but that didn't work either.
There are lots of examples of using Test.loadData with built-in sObjects, such as Account and Contacts, but no examples showing custom sObjects. I'm starting to think this just isn't possible with custom objects.
Using test.loadData most certainly does work with custom objects. The test data CSV header only needs the field names, as you have in your example.
Your code also looks good. The only difference I could spot is that your variable is a strongly typed list. In my code I use a List which seems to work:
List<sObject> testdata = Test.loadData(MyCustomObject__c.sObjectType, 'mytestdatafile');