We currently have a form that performs a lookup of an employee's information in our HR software. It does the initial lookup by the employee's email address. It then retrieves what's called a "supervisors namekey". Once the "supervisors namekey" is populated in a field it then does a second lookup using the namekey for a record and pulls that records "supervisors username" and "supervisors email address". We use those two fields to dynamically assign user tasks to supervisors. The namekey field is a hidden field since it is a little cryptic and if it is incorrect than the entire lookup does not work.
The Problem: We are discovering that some employees have more than one record and each with a different supervisor. So when the email address is looked up, it does not fill in the "Supervisors Namekey" field because one needs to be selected from the two available.
We need a way for these special end users to be able to select which supervisor it should go to. Since the namekey is not very useful, it would be best if they could select the actual supervisors name (which can be pulled from the same lookup) and then have it populate the "supervisors username" and "supervisors email address".
I'm not the best at jQuery, so any helpful solutions are welcomed.