Can a Lookup Populate Multiple Hidden Fields, from a URL Parameter?

By: Mark Hansen | Asked: 02/03/2023
ForumsCategory: General questionsCan a Lookup Populate Multiple Hidden Fields, from a URL Parameter?
Mark HansenMark Hansen asked 1 year ago
I've used Lookup fields to populate different things but I seem to be stuck at the moment and thought I would ask if it is possible before spending more time trying to figure it out. I seem to be going in circles and feel like I'm missing something very simple. (My wife would blindly agree!) 
  • I have a simple form on one page that passes a TaskID value to a second form on second page via query string. These are separate forms.
  • The TaskID is used for internal purposes and stored in a hidden field on the second form page. It helps us assign and route the user based on the Task.
  • The second form is submit, I get the email which includes the TaskID, and the rest of the information the user submits. 
The issue: I need more information about the Task (Task name, task description, etc) and thought it would be an easy exercise to use a lookup field and pull the rest of the data about that task into the form (hidden fields) and include it in the email sent to me, instead of having to cross reference the TaskID internally, lookup what it means, etc. We have roughly 650 tasks, so with every new email I find myself spending several minutes drilling into the task to get the fine details.  The TaskID is associated with a Formidable data source in which I have a few other fields of data related to that task. TaskOwner, TaskName, TaskParent, TaskFee, and of course, TaskID, which is the same number pulled earlier.  What I need to do, is use that TaskID from the hidden field and use lookup to pull more information about that task into the form, so I can send it via email and eliminate the time spent matching tasks it's details. Is this possible? Am I missing something simple? To summarize: 
  1. I have a hidden field with a TaskID that matches a TaskID field in a separate Formidable data source.
  2. I want to use that hidden field TaskID as the "watch lookup field" I match to my data source.
Thanks in advance,
Mark    
1 Answers
Victor Font answered 1 year ago

This is a perfect requirement to use dynamic fields for the task id lookup instead of standard lookup fields. If you use dynamic fields, the value stored in the hidden field on form 2 would be the entry id of the task rather than the actual task id. You can use values from that entry to be the default values for additional hidden fields on form 2. You can literally bring every field in the lookup row to form 2 just by passing the task's entry id instead of textual value. See this: https://formidableforms.com/knowledgebase/dynamic/#kb-display-dynamic-field-values. You would use the first shortcode option [x show="y"] in the hidden field default value field. x is the id of the field in form 2 that holds the lookup table entry id, and y is the id of the field in the lookup table you want to save in form 2.

Mark HansenMark Hansen replied 1 year ago

Thanks, Victor - I'll jump into the dynamic field KB and see if that does the trick for me. Much appreciated, as always.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right