Flow Designer - Ask for approval activity is not working

MDRaheem
Kilo Explorer

I am trying to trigger approvals in my Flow, but I am unable to pass the sys_id in the “Ask for Approval” activity.


Use case:
I have created a custom action that fetches the approver’s sys_id based on certain conditions. The approvals are dynamic, and I am able to retrieve the approval record successfully.

However, when I pass this approval sys_id into the “Ask for Approval” activity, it is not being accepted and throws an error (see screenshot below).



Could someone please help me understand how to correctly pass the approval record into the “Ask for Approval” activity? Any help would be greatly appreciated.


Thanks in advance.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@MDRaheem 

use inline script and access the output from action

Scripted Approvals in Flow Designer with Flow Variables 

AnkurBawiskar_0-1770874470185.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

yashkamde
Tera Guru

Hello @MDRaheem ,

 

You passing sys_id directly in Ask for approval will not help, instead of this you need to wrap that in the string like :

outputs.result = "ApprovesAnyU[" + sys_id + "]"

while passing result in custom action :


And then pass the output of action into flow designer Ask for approval :

Screenshot 2026-02-12 112716.png

 

Also your custom Action Output should look like this then this will work :
Screenshot 2026-02-12 112612.png

 

If my response helped mark as helpful and accept the solution.