Hi,
I am trying to create a Data Service for a Chart widget but I am not able to get the right output parameters for the data to be properly displayed in the Chart Widget.
I am using an ION API type data service which is actually calling the an APIFlow endpoint :
The API response is:
The Output parameter looks like (latest try I did):
As you can see, the widget is not getting all the categories/values:
Does anyone can help to adress the dataservice output?
Thanks
I believe your root element should look like: $.result[*] and then the output parameters at the bottom should just be .count and .category
Is this widget getting the most updated data service? If along the way you made a change to the data service, the existing widget would be out of sync with the data service. The data service attached to a widget is essentially a copy at the time of creation, it is not directly linked. This is my best guess as to what happened here, try creating a new widget and see if that fixes the issue.
Hi Caitlin,
I get your point. I don't think the issue comes from this because I actually never saved the Widget since It didn't show the data correctly. So I keep discarding and re-creating the Widget each time I change the data service configuration.
I do not have access to a working example of a Chart widget project in my tenant ( which I think could be helpful).
Are you able to create other widgets off this data service? If you do a list widget, are both properties showing up as options in the designer?
I get only the first instant in the array.
Can you send me your response from the test data service screen? I think your root element in the output screen is incorrect.
Thank you Caitlin. Yes, moving the .result[*] to the output root element did the fixe.
This is the dataservices configuration I capture in the logs
{ "message": "Success", "internalCode": "OK", "data": [ { "id": "91188ac8-1ad3-48af-945d-491d498f0ae8", "suite": "/APIFLOWS", "author": "b326770c-0758-487d-b75b-e22c7e752c31", "method": "GET", "headers": { "accept": "application/json" }, "typedef": "GENERIC", "version": 2, "endpoint": "/fhir_patients_by_gender/", "mutation": 17, "resource": "patients_by_gender?ionapiRespStyle={ionapiRespStyle}", "changedBy": "b326770c-0758-487d-b75b-e22c7e752c31", "rowStatus": { "icon": "new", "text": "New", "tooltip": "New" }, "outputJson": "{}", "changedDate": 1705751721311, "displayName": "fhir_patients_by_gender1", "inputSchema": null, "creationDate": 1705507425782, "isOutputFile": false, "objectIdPath": "", "outputSchema": { "type": "object", "properties": {} }, "inputParameters": [ { "id": "1705506478463809511", "key": "ionapiRespStyle", "alias": "", "required": true, "valueType": 1, "defaultValue": "sync", "parameterType": 2 } ], "outputParameters": [ { "id": "1705751672179125999", "key": ".category", "alias": "category", "required": false, "valueType": 1, "parameterType": 4 }, { "id": "1705751686711557380", "key": ".count", "alias": "count", "required": false, "valueType": 1, "parameterType": 4 } ], "outputRootElement": "$.result[*]" } ]}