How to get current sys_id in ACTION (in flow designer)?

Vivek Tirpude
Giga Contributor

Hi,

How to get the current.sys_id of the current record where FLOW (with Action) is running?
find_real_file.png

 

1 ACCEPTED SOLUTION

Hi,

I'm not suggesting you to hard code the sys_id. Hope you have a custom Action created and is called from a flow. The current record of flow is not accessible to action. You need to pass this as input parameter to the action.  

In Action, create a Action Input with name as sys_id and Type as string. You need to pass the sys_id of the record from the flow so that it is dynamic to the flow (drag and drop sys_id field of the trigger record as input to the action).

In the script step, add a Input variable, set some valid name (sys_id). In value field of this param you can drag and drop the sys_id from Input Variables

Now you can refer this sy_id as input.sys_id or input['sys_id'] in the script. This holds the dynamic value passed from the flow.

  

Thank you,
Palani

View solution in original post

7 REPLIES 7

Thanks @palanikumar we're able to add the record sys_id as you advised. Thank you ????
find_real_file.png

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

try this

var sysId = fd_data.trigger.current.sys_id;

if that doesn't work then send the record sysId as input to subflow and access the value within the script

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0827189

Regards
Ankur

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

Thanks Ankur, let me try this. I'll reply here with results