Url Data Provider

Url Data Provider

General Info

This data provider can be used to fetch information from a URL. The data should be formatted within the file in JSON format, so that they are properly deserialized properly to objects and arrays upon retrieval. The "Url" property defines the source of the file. 

Example

Let's assume you have a Combobox control with Employee records, for which the Lookup values should be retrieved from json file located in the "Documents" library of your SharePoint site. In this scenario, you would create a Url Data Provider in the "Lookup Values" property of the control:




If you are about to upload a JSON file into a SharePoint document library, it is highliy recommended that you change the extension to something other than .json (for example ".txt"). SharePoint by default blocks direct access to non-document file extensions. 

The file contents could be a json array like the following:
[ { "EmployeeID": "25424", "Name": "John Black", "Position": "Operator", "Age": "28" }, { "EmployeeID": "00108", "Name": "Jack White", "Position": "Director", "Age": "42" }, { "EmployeeID": "14225", "Name": "Synthia Johnson", "Position": "Administrative Assistant", "Age": "40" } ]

Therefore we can set the Lookup Value Field ("EmployeeID") and Lookup Display Field ("Name") properties in the Combobox, accordingly:


and get the final result in our form:


See Also

For more info about the concept of Data Providers, their usage and their common properties (Name, OnDataLoaded, Condition, etc) see Basic Concepts: Intro to Data Providers