- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2024 10:19 PM
I have a requirement that inbound email action when email received by instance then need to create a RITM with SC TASK in fields we have requested for that value need to set the variables so have variables requested for (u_requested_for) this value I'm setting through flow designer but its not getting populate . in workflow i have used as run script activity in starting stage its not worked and have used business rule that's also not worked how to archive this feet.
i have used script BR
current.request.requested_for=current.variables.u_requested_for; // this not working
In workflow i have used this in first activity
workflow.scratchpad.requested = current.request.requested_for.getDisplayValue();
I have used this after approval activity in workflow in logs I'm getting the value but value haven't set for variable
current.variables.u_requested_for = workflow.scratchpad.requested;
Thanks,
Kishore.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 06:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2024 10:49 PM
you want to set variable (u_requested_for) value or field (requested_for for REQ) value?
For setting the requested_for on REQ use this in after insert BR of RITM table
var req = current.request.getRefRecord();
req.requested_for = current.variables.u_requested_for;
req.update();
For setting the variable value use workflow run script
workflow.scratchpad.requested = current.request.requested_for;
current.variables.u_requested_for = workflow.scratchpad.requested;
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
‎01-01-2024 11:31 PM
Hi Ankur,
Thanks for the your reply need to set the variable value based on (Requested for) from RITM or REQ
i have used this in workflow value passing but value not setting for the u_requested_for variable this is the issue
workflow.scratchpad.requested = current.request.requested_for; current.variables.u_requested_for = workflow.scratchpad.requested;
Thanks,
Kishore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 01:09 AM
u_requested_for variable is of what type? reference right?
any reference qualifier is present on that variable?
if it's reference then it requires sysId and not display value
If you are using after insert BR then use current.update()
current.variables.u_requested_for = current.request.requested_for;
current.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
‎01-02-2024 01:41 AM - edited ‎01-02-2024 01:48 AM
u_requested_for variable is reference type- No good luck for this i have used this script in BR
The variable don't have any conditions as well as don't have any reference qualifiers
current.variables.u_requested_for = current.request.requested_for;
current.update();