- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 08:06 AM
Hi,
How to get the current.sys_id of the current record where FLOW (with Action) is running?
Solved! Go to Solution.
- Labels:
-
Flow Designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 08:26 AM
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.
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2022 12:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 08:21 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 08:25 AM
Thanks Ankur, let me try this. I'll reply here with results