How to create a data set
Data sets pull data from a data source such as IFS, SQL Server or any source that provides an API. They are set up to retrieve the data when a form is accessed by a user. Data sets allow you to populate a form with relevant data from another source applicable to the form. For example, you may have a customer with 5 contact records. Once the customer is selected on a form, a table would fill with all 5 of these contacts.
Data sets can also be added to Lookup, Select, Radio inputs and Segmented Buttons.
A data connection needs to be set up to retrieve the information from the primary source. Then you can create data sets of information that are pulled from that source to be used on a form. You can have many data sets per connection.
The data set can be filtered by connecting form fields to the data set. If the data in data sets is editable, it is editable in the dynamic table as well. Sub-tables can be a field type of a dynamic table, which is opened from a row or column. A sub-table can contain a sub-table and there is no limit, other than what is usable on the device and report.
- From the Reusable Components menu, select Data Sets. Click New Data Set. The Data Set Designer opens.
- In the Data Set Name field, enter a name for the data set. Duplicate names for data sets are not allowed. The name must be unique.
- Toggle the Real Time Data Set toggle on if the data set is real time or if it should be synced as part of the device sync. If this option is toggled on, you must select at least one parameter to prevent a large amount of data being "pulled."
- Specify how long synced data is kept and re-used before it is replaced by updated data. From the Refresh App Data field, specify when you want to sync the data:
Select At Sync to sync data in a data set each time a sync is performed.
Select On Demand to sync the data set the first time the data set is used on a form. If there is no data, then the sync is performed only when the Refresh Now button is clicked.
Click Refresh Now to sync the data so it is current the next time the form is used. - From the Data Connection field, select the data connection from which the data is to be retrieved.
- From the Data Origination field, select the data origination for the method of connection. Selections include None, SQL Query, HTTP GET and XML Query.
- Click Add Parameter Placeholders to add a Parameter field. Parameters are used to filter the data set when retrieving the data from the server. They help bring only the applicable information from the parameter. For example, they could be used in a WHERE clause in the query:
They can be used in a deep link and the value would be supplied at the time of the deep link execution. Keep in mind the dataset parameter is passed in as a string, even if it is a number, then you must convert it to an integer. - Enter the query or proc that will be used to retrieve the data fields.
- Click Generate Data Fields to run the query and display a subset of the data to help you determine whether the query is correct. If the data retrieved does not return any rows it displays a row of sample data. The Format Data Set Data window can still be used.
Note: If you edit the query, click the Generate Data Fields button again to display the changes in the data. - If you want to provide the ability to change the labels for use on the app, click (Edit icon) next to the data set to open the Format Data Set Data window.
- You can reuse data sets on multiple forms, but there may be times when want to make a slight change to the data set and don't want to create a brand-new data set. Click (Copy) to copy the data set then make changes as needed to the copied data set.
- Click (Save) to save the data set.
- To review a data set's performance, view the Data Set Performance Log.