Hey, So I created form A, that uses a lookup field for account number. When Account Number is entered, the lookup field looks for the account number in form B. If it finds the account number in form B, the information is used to populate the remainder of the fields in form A. This was working great until I decided to update Form A by changing Name from "text" to "name" , and Address from "text" to "address" I now realize that neither the name or address fields use the lookup feature. Although I understad this might be available in future versions, currently I cannot pass the entry id to the form, because it does not exist until the user enters the account number on the form, so I won't have access to the entry id until the form is already loaded and the user enters the number. I thought if I could access the entry id of the selected entry from form B in the lookup field I could use [frm-field-value field_id=727 entry="id" show=first] to populate the name and address fields. Any help or suggestions would be greatly appriciated. Thanks
Dynamic lookup fields are one of the most powerful ways to display lookup data in views. There is a big difference in how the different types of lookup fields work and it pays to know the difference. https://formidableforms.com/knowledgebase/dynamic-vs-lookup-fields/
In your scenario, I would use Ajax instead of lookup fields. With Ajax, when the user enters the account # on the front end, your Ajax function would do a record lookup in real time on the back end where your custom PHP callback function returns a JSON payload to the browser where you can populate the fields on the front end without the user's session being interrupted.
As a data design FYI, depending upon how you designed your forms to cooperate with each other in your application, you may run into "single source of truth" consequences. A basic data management principle is that every piece of metadata has a single origin and is stored only once. This is called "single source of truth".
In your design, you have account numbers and addresses in form B. Because you are using Form B as a lookup table, it is your primary data source and should be the single source of truth. If you are storing the address in Form A after you look it up in Form B, you no longer have a single source of truth. Your design violates the principle and the system becomes harder to maintain for your client.
Awesome. Thanks. I was trying to simply use the built in lookup function. Fast and easy. The wrench in the works was when I realized the lookup function is not yet available for name and address field types. I was hoping not to write any code and use formidable, but you are correct it might be best under these circumstances. And you are right on the structure but the client has specific recording keeping procedures that require duplicate data for one dataset. So, I though an autofill from form b to duplicate the data was a fast and efficient method to accomplish this goal, and it may still be the case but apparently not with the built in lookup function, so again thanks for your help. I did not think of Ajax and custom backend. Thanks again.
Please login or Register to submit your answer