REST Testing woes

I'm trying to play around with utilizing a REST endpoint. My data is pretty simple, it looks as follows:

I have everything set up the way I think it "should" be. However, my datagrid is empty. The headers show fine, but there's no actual data.

Additionally, I see no errors and the response is clearly being returned by the endpoint. I'm at a loss.

Here is the example JSON:
[{
"LocationId": 2952001,
"LocationDescription": "Test1",
"OutboundConnectionName": "PT_Message_To_File_ORU",
"OptionSendPdf": true
}, {
"LocationId": 2977001,
"LocationDescription": "Test2",
"OutboundConnectionName": "PT_Message_To_File_ORU",
"OptionSendPdf": true
}, {
"LocationId": 2977002,
"LocationDescription": "Test3",
"OutboundConnectionName": "PT_Message_To_File_ORU",
"OptionSendPdf": true
}, {
"LocationId": 4982001,
"LocationDescription": "Test4",
"OutboundConnectionName": "PT_Message_To_File_ORU",
"OptionSendPdf": true
}
]
The Data Source
image
image

Page Load Event:
image

Datagrid properties:

What I see:

I am sure this is all due to something I am missing, but I am not sure what it is!

There is an extra schema LocationsResponse which is not needed. The response you have described would look like { locations: [... ] } but it should be [...]. To fix that do the following:

  1. Delete the LocationsResponse schema
  2. Set the Schema of the GetLocations resource to Location and check the Array checkbox.
  3. Data-bind the DataGrid component again.

Thanks,

The problem was that I incorrectly assumed I needed to create an object to hold my array of objects within Radzen. I wasn't really understanding the relationship between the schema and the resource.

As a side note, perhaps a good feature request would be to have a wizard or tool that builds a schema from an example JSON document. A really complicated schema with multiple levels of arrays could get really confusing really fast.

Another suggestion would be to represent the schemas in a better view. Either as JSON or in a tree view so we can see the hierarchy as we build it.

1 Like

Hi @Tharkis,

Indeed there is a room for improvement in the way REST data sources are defined in Radzen. We have an item for that on our TODO list and will work in it in 2019.

1 Like

Thanks, I appreciate the consideration.

Is there any chance we'll see an updated roadmap for 2019 in the near future?