Populate a field based on another field...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 06:55 AM
I'm not sure on the best way to go about this - but I have a 'User Access Orch References' table that has orch_name, input parm 1 and input parm 2 which is the source for fields on another table/form and needs to cover various orchestrations for Access Request so there may or may not be a relationship between input parm 1 and input parm 2 depending on the orchestration input requirements. This table is also populated through LDAP connections that run nightly. It would be easier if this info was in a Choice List.
So when the Orch-Name-Add is selected in the screen shot below via Choice List (if I referenced the 'User Access Orch References' table to get this information it showed multiple times for each record in the table, so went with Choice list, but if there is another way, please advise).
Then the drop down for the Input Parm 1-Add is populated (via javascript reference qual in the Dictionary entry) with values from the 'User Access Orch References' table for selection.
The question is, I need the Input Parm 2-Add to auto-populate from the 'User Access Orch Reference' table based on the Input Parm 1 value ONLY if the Orch Name is (TH) Add User to Grp.
What is the best way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 07:28 AM
Rebecca,
If I understand this correctly, I am pretty sure the best way to handle this would be to use a client script and GlideAjax. You can check 'onChange()' if the 'Orch Name - Add' value is the one you want, and if so, perform a GlideRecord query to the 'User Access Orch Reference' table to retrieve the data you want to set the value of the 'Input Parm 2 -Add' field with that data.
Hope that points you in the right direction!
Cheers,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 07:29 AM
Client Script or Business Rule can pre-populate that field for you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 07:31 AM
You could try a client script onChange of Orch Name. Write an if something like:
var parm1 = g_form.getValue(input_parm_1_name);
if(newValue == TH && parm1 == <desired value>) {
g_form.setValue('input_parm_2_name', <desired value>);
}
If you need the value of input_parm_2 from a different table I would recommend using a Script Include with a GlideRecord for that table. Pass it whatever you need for the query and I think you'll be good to go.
I hope this helped, let me know!
Dylan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 07:36 AM
This might help you with the Script Include: