- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 01:23 AM
Hi,
We have a Contract number Variable in RITM which is a ReadOnly field.
we have a flow designer where we are creating new Contract record after closing the catalog task. So once the Contract record is created we need to update that record number in RITM Contract number variabale. For these we have written one script in update record action.
But this is not working, while we are testing we are getting an error as
Error: "Cannot read property "request_item" from null,Detail: Cannot read property "request_item" from null"
Any lead Please
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 03:43 AM
the way how you are updating the RITM record is not correct.
sc_item_option_mtom table stores all the variable associated with RITM, you can use lookup action in flow designer and can update the variables value in "sc_item_option"
Something like this
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:29 AM
Hi Siva,
you mean only this one is enough? should i remove everything else
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:30 AM
Nope. Please use the script as suggetsed by Ankur.
just replace the 3rd line with below one.
ritm.variables.contract_number = fd_data._23_create_record.record.sys_id;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:57 AM
Folow the below article. it'll help you to update the variables in flow.
https://www.servicenow.com/community/now-platform-articles/set-value-of-a-catalog-variable-at-flow-d...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:33 AM
then this will work
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(fd_data.trigger.request_item.sys_id)) {
ritm.variables.contract_number = fd_data._23_create_record.record.sys_id;
ritm.update();
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:39 AM - edited 04-07-2025 02:40 AM
Hi Ankur,
I tried with your script, but I am getting an error while saving/Publish