- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2025 11:34 AM
I have a form that contains a Lookup Select Box type question. The form needs to be submitted for every room record in cmn_location table. I can select a data pill for line text questions, but not for lookup select box.
I want the select box to be set to Location Record > Name, however lookup select box doesn't seem to support record data pills. For reference, here is the question's specifications:
So the value I want is included in the lookup of the select box, but I can't find a way to select it.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2025 04:55 AM
I have an action I built (which I probably found somewhere, but I don't remember where, so I can't give credit) to update a catalog variable on a RITM. You can create this action and run it after submitting the new RITM and pass it that RITM and the value you want to set. Here are the details of that action:
This is the script from the script step:
(function execute(inputs, outputs) {
try {
var variables = inputs.requested_item.variables.getElements();
for (var i = 0; i < variables.length; i++) {
var question = variables[i].getQuestion();
if (question.getName() == inputs.variable_name) {
question.setValue(inputs.variable_value);
}
}
inputs.requested_item.update();
outputs.state = 'success';
}
catch (e) {
gs.error(e);
outputs.state = 'error';
}
})(inputs, outputs);
This is the output from the script step:
Then I set the overall state to the state from the script step.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2025 04:55 AM
I have an action I built (which I probably found somewhere, but I don't remember where, so I can't give credit) to update a catalog variable on a RITM. You can create this action and run it after submitting the new RITM and pass it that RITM and the value you want to set. Here are the details of that action:
This is the script from the script step:
(function execute(inputs, outputs) {
try {
var variables = inputs.requested_item.variables.getElements();
for (var i = 0; i < variables.length; i++) {
var question = variables[i].getQuestion();
if (question.getName() == inputs.variable_name) {
question.setValue(inputs.variable_value);
}
}
inputs.requested_item.update();
outputs.state = 'success';
}
catch (e) {
gs.error(e);
outputs.state = 'error';
}
})(inputs, outputs);
This is the output from the script step:
Then I set the overall state to the state from the script step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2025 08:55 PM
Thank you so much for the script, and the idea to set up a custom action. I was trying to do it with existing actions and could not get it to work no matter what. Thanks for the solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2025 09:20 PM
The script does not seem to work for choice variables, it doesn't update the Lookup Select Box questions in the RITMs.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2025 05:11 AM
A Lookup Select Box variable stores the sys_id of the selected record from the lookup table, not the text value displayed in the dropdown. Are you sending that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2025 08:56 AM
Did you get a chance to check this?
The link I shared has working solution and you can enhance it further.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader