Server Request (JSON) Datasource
The feature is available starting with modules released after 10th of May 2019 (Action Form 5.0.540)
This datasource type allows you to use an API:
- either internal (your own) built with DNN API endpoint module
- or external (3rd party) from any webservice you might want to integrate with
as source of data for your multiple choice fields.
The output of the API whould be a valid JSON list (an array of objects) similar to:
- either directly an array
[{ "UserId": "8", "FirstName": "Name1" }, { "UserId": "5", "FirstName": "SomeName" }]
- or the array is a value of one of the JSON parameters, situation in which you will need to provide the correct JSON path to the array ($.results or results)
{ "timestamp": "19:55", "date": "2019-05-20", "results": "[{\"UserId\":\"8\",\"FirstName\":\"Name1\"}, {\"UserId\":\"5\",\"FirstName\":\"SomeName\"}]" }
As for all datasources, it is also based on Text|Value and you will have to:
- either name the JSON properties as Text/Value
- or specify in the multiple choice field settings which JSON property to be used as Text and which one to be used as Value (see example in the image above)