Populating ServiceNow variable through the Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 01:26 AM
I have a Workflow script, that is assigning values to different variables. Below is that script:
I have created a new variable Approval to Hire ID, and I want to assign this value also. I've written the below line but that's not working:
grReqItem.variables.u_approval_to_hire_id = current.variables.u_approval_to_hire_id;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 01:50 AM
so all the lines are working except this line?
grReqItem.variables.u_approval_to_hire_id = current.variables.u_approval_to_hire_id;
If it's a new variable then it won't have value for the older RITM
what's your business requirement here? updating variables for which RITM and from which RITM?
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
02-06-2025 01:55 AM
yes, except this everything is working fine.
The business requirement is to show these variables in the Variable Editor section on the RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 02:20 AM
but why are you populating it from workflow?
You didn't answer the other question
what's your business requirement here? updating variables for which RITM and from which RITM?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 02:25 AM
It has already set up through the workflow.
And there is a record producer that once submitted, generates an RITM against a REQ. So the variables are setting up through the workflow, that is running behind