Workflow approval script is not working in requted item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi All,
I am using the scripts for the individual approval based on the group person, for the catalog approval
Here is my code for the request item
current.variables.please_select_sr_approval
when i put logs it was printing, but unable to send request for the approval person.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Can you please paste the screenshot of your workflow ? Usually script is not required, you can directly use the action if you are using flow designer .
Regards,
Nayan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Or else if you are using the workflow then you need to use the .push() function .
eg. answer.push(current.variables.<variables_name>.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
in your workflow approval user script you should set answer array with the approver
Set the advanced checkbox and give script
I assume your variable "please_select_sr_approval" is reference to user table
answer = [];
answer.push(current.variables.please_select_sr_approval.toString());
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Ankur Bawiskar ,
I am using the same, but it was not triggering it was showing the empty.
answer = []; answer.push(current.variables.please_select_sr_approval.toString());