Overview
Once you have a data table created in Mirata, you can create queries to grab subsets of that dataset. These queries can be used to bring data into Mirata forms.
To demonstrate how to do this, we’ll walk through how to set up an example use case in this article. Let’s say your use case is: You have a data table (List Numbers by Region in this exmaple) that holds all viable line number / region pairs (below screenshot). You’re building a form in which the technician will provide what region they’re doing the work in and then they need to select a viable line number based on that region. So, if they select that they’re working in the South region, then they select either 20, 4000, or 1 as the line number
Building the Data Table Query
Create an Integration Action
First, create an integration action to query your data table.
Go to
Integration Actionsin the Admin ToolClick
+ADD INTEGRATION ACTIONEnter a descriptive name for the integration action (this is how form designers will find it)
For Action Request Type, select
Data Table RequestClick
SAVE
Configure and Build the Query
Next, we will need to to add an Input Parameter for Region.
Navigate to the
INPUTStabSelect
+ ADDFor Name, set it to the column you are querying off of (in this case, it will be Region)
For Type, set it to match your column in the CSV
Click
SAVE
Once the Input Parameter has been created, we can create the request and select the data table we will be querying.
Navigate to the
REQUESTTabSelect the
Data TableRequest type will be
QueryUnder Query Parameters, select the
+Select Region
Within the Where statement:
Change Constant to
Input ParameterUnder Select a Parameter, select Region
Test the Query
Now test the query
Go to the
TESTtabEnter a sample value for your input parameter (e.g., "South" for "Region")
Click
RUN TEST. Verify that the results are as expected. Testing ensures the query functions correctly before integrating it into your form.
Setting up the Dropdowns in your form
Configure the Dropdowns
Add two dropdown components to your form canvas: one for the region and one for the line number. Configure their names and labels accordingly.
For the Region dropdown, in the
Datatab:Select Reference Table as the Source Type
Set
Return,Display, andSort ByasRegion
For the Line Number dropdown in the Data tab:
Select
Query Tableas the Source TypeSelect
Get Line Numbers by Regionas yourQueryReturn,SortOrder, andDisplaywill be set to LineNumberUnder
PARAMETERSset the key to Region (the PARAMETERS section will appear if the Integration Action has Input Parameters)Select the pencil next to Default and create a calculation to call on the Region dropdown in the form to connect the input parameter with the field.
Testing in Preview Mode
Once we go to Preview Mode, we can see that once you select a Region the dropdown options should display the Line Numbers only associated with their corresponding region.