Dynamic Data (Lookup Query)
With Dynamic Data, you can populate a field(s) with values looked up from an alternate datasource. This is especially useful when you need to populate a large number of values (as in a Drop-down Menu), or when the values that return from the table change according to other selections on the form.
MultiField Population
Use the MultiField Population option of Dynamic Data to lookup a record and load all of its data into a set of fields on the form. You can also populate multiple fields with the returned data.
Multiple Field Sequential Population
When allowing multiple selections from the Dynamic Data Field (For example, using a CheckBox, or a Drop Down with Multiple enabled), this checkbox tells the Multi FIeld Population routine to look for mapped destination fields that end with a "1" and then look for sequentially named fields (i.e. Name1, Name2, Name3) and route each selection from the Dynamic Data results into each field.
Watch this video to learn more and see some tutorial examples, then read below to learn how to configure dynamic data for your form.
The Dynamic Data property is available in these elements: Drop-down Menu, Radio Button, Checkbox and the Dynamic Heading Element. Once you place one of these elements onto your form, locate the Dynamic Data property in the Element Properties Panel, then click the small button to launch the wizard. Follow these steps:
- Choose Local Form to pull data from a logiforms form/table or choose External Data Source to connect to a remote API and return live external data. Returning External Data is an Enterprise Plus Plan feature. Read more about External Dynamic Data.
- If you choose "Local Form", follow these steps:
-
Make a choice from the Lookup Form / Table drop-down menu.
-
You can either check the box to Return all records, or
-
instead choose Edit Query to configure a rule that will control which data is returned based on selections made on the form or static lookup values.
-
Click Next to configure more options.
-
Click the wildcard button, , to choose a field from which the Display Value will be taken. You can also combine values from the lookup table (e.g '[first name] [last name]')
-
Check the Alternate Data Values box to choose a alternate field/column to use for the data value. The display value is the value shown to the user (e.g., [Event Name]) and the data value is the value that gets recorded in the database (e.g., [eventID]). If you do not choose an alternate data value, then the display value is used and recorded with the submission.
-
Check the Return Bind Values box to choose an alternate column/field from the lookup table to populate the bind value property. The bind value property is typically used in bindings and calculations. For example, your dynamic lookup may return available tickets for an event. You may opt to return the [Price] field as the bind value so you can use it easily in a calculation.
-
You can also populate other fields on the form with lookup values that correspond to the value chosen in this element. For MultiField Population, click the Settings button to open a window in which you may choose a Dynamic Data Field and corresponding Destination Form Field.
-
Click Next to move on to the Sort Order step. Choose which fields you want to sort on, and then select Descending or Ascending order.
-
Click Finish to commit the changes, then preview the form to see the data populate the element.
Using Select Distinct?
When using the Select Distinct option, the Display Value must be a single field (not a concatenated string) or, alternatively, you can enable the alternate data value and select the field you would like to use in the select Distinct filtering operation.
Pro Tip
You can run dynamic data in the background! For example, you could set up Dynamic Data on a drop down menu and write a query that looks up records where EmployeeID = [The value entered in the employeeID field]. You can hide the drop down that has dynamic data associated with it and only show the employee ID input field. When the end user types their employee ID, the looked data will be returned and can be used to display the employee info or to populate a set of fields-
Gregg Turnbull Can we set the filter to compare to dynamic values, specifically trying to get all records with a date greater than or equal to today shortcake but it just empties out the short code on save. Is there a way to have this filter work:
Thanks indeed,
Gregg
-
Clinton Tu Hi Greg,
That actually should work. Another way to do it would be to create a DateField on your form and set the default value to [today] and then reference that field in your filter. That would work for sure.
-
Gregg Turnbull Hello Clinton - Sorry for my extreme delay - I guess I was unclear in my question, I would like the date to filter to be based on the current date, so when it pulls the list of classes (in this case), it is only grabbing data on classes with a date that take place today or in the future.
Thanks,
Gregg
3 Comments