(1) Build a Data Table Query (Integration Action)
The first thing you’ll need to do is build a data table query, which is just a specific type of Integration Action. You’ll create an Integration Action of type Data Table Request and then select Query as the type of Data Table Request.
To create one in the Admin Tool follow the below steps:
Create an Integration Action:
- Go to the ADMIN TOOL tab and then the Integration Actions tab
- Click +ADD INTEGRATION ACTION
- Name: Set a name for your action (this is how form designers will find the action)
- Action Request Type: Select Data Table Request
- Click SAVE
Select Data Table Request and Query:
- Go to the REQUEST tab
- Data Table: Select your data table that you want to query. I’ll select “LIne Numbers by Region”.
- Request Type: Select “Query”
- Now you’ll see “Query Parameters” options below with a +ADD button to build out your query
Build your query using the Query Builder:
- Click +ADD and select the column from your data table that you want to search by. In our example, we’ll select Region.
- You have many options to query by if the values in the column contain, begin with, doesn’t contain, exist, etc. and to type in a constant value or use an input parameter. In this simple example, we want to search for records where the region equals an input parameter.
- Select Input Parameter in place of Constant
- Click the Select a Parameter dropdown and then click Add an Input Parameter
- Click SAVE
- Now we’re done building our query so click SAVE in the top right
Test your query:
- Go to the TEST tab (you always want to test your query before adding it to a form)
- Enter a sample value for your input parameter(s). In our case, Region. I’ll enter “South”.
- Click RUN TEST
- You should see a success message and see the records you were expecting appear in the results (in our case, that’s 20, 4000, and 1). If this is not the case, you should review the above steps to make sure you set up the request correctly and try testing again.
On your form, we want to add two dropdown components, one for the region and one for the line number. After you’ve added these two fields and named & labeled them, follow the below steps:
Set up the first (Region) dropdown using Reference Table:
- In the Data tab of the right panel for the region dropdown, use Source Type of Reference Table to make the options and returned values our list of regions (North, South, and West)
Go to the Source Dropdown Options from a Data Table article for more detailed instructions on this step
Set up your second (Line Number) dropdown using query table:
In the Data tab of the right panel for the line number dropdown:
- Source Type: Select “Query Table”
- Query: Select your query name
- If you have any input parameters, like we do in this example, you’ll see the PARAMETERS section appear at the bottom and list your input parameters
Map your input parameters:
- There will be a “+” button to the right of each input parameter. Use that to map each input parameter to the desired value. In our example, we’ll map the Region input parameter simply to the Region dropdown field (see the screenshot of the String Calculation below).
Set Return, Sort By, and Display:
- Return & Display: For Return, select the column from your table that holds the data you want to hold behind the scenes. For Display, select the column from your table that holds the values you want the form user to see. In this example, I want to select Region for both.
- Sort By & Sort Order: For Sort By, select a column from your table that you want to use to sort the Display list. You can select the Sort Order as either ascending or descending.
Preview to test it out:
- Now if we go to Preview Mode, we’ll see that when you select a Region, the options for Line Number change appropriately.