We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Flow Designer - Ask for approval activity is not working

MDRaheem
Mega Contributor

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.

1 ACCEPTED SOLUTION

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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@MDRaheem 

Hope you are doing good.

Did my reply answer your question?

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

Thank you so much for the help. It is working perfectly fine now.

yashkamde
Kilo Sage

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.