It seems like Lookup Rules might be executed twice: once when displaying the form fields, and again during the form submission process.
I have a Form (v9.2) with a text input field (User AD ID) and a read-only field (Employee Number) that is populated with a Lookup Rule (i.e. the user enters text into the input field and presses tab which triggers the Lookup Rule to populate the read-only field). For example, the user enters "kwoychesko" for the User AD ID and the Lookup Rule populates "1000" into the Employee Number field. When the form is submitted, a workflow runs and uses the lookup data (e.g. 1000) to do various tasks.
This normally works, unless the text input field is auto-corrected by the browser. For example, if the user enters "tli" (for Tom Li) and presses tab, two things happen:
- The Lookup Rules display the correct Employee Number "1050" for user "tli", but
- The browser subtly auto-corrects "tli" to "tai".
When the form is submitted, the Thank You page does not show the same information as the user saw, instead it shows the results of doing the Lookup using "tai" -- the Employee Number field is blank because no user "tai" exists in the database. So it seems like the Lookup Rules must have executed again.
If it does execute the Lookup Rules twice, I think this is a problem, not just for my use-case. For my use-case, you could argue that the Form submitter should have noticed the subtle change from "tli" to "tai", even though the rest of the looked-up data is correct. For other use-cases though, it's more of a problem:
- What if the backend database changes quite often, such as a db that contains transactional data? The results displayed on the form to the user might not be the same as during the second lookup.
- What if the database has a stored procedure that is executed on each lookup? The SP would execute twice as many times as it should.
Thanks for any input!
Ken