Script step output variable value not passing to custom action output variable in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2025 11:31 PM
Hi,
I have an issue. In flow designer, there is a script step in one custom action, where there is output variable called "object_value" (type object). And I am populating it in script step using outputs.object_value. After populating it, I have converted it into text value using JSON.stringify() and tried to print it in logs using gs.error(), then the key-value pairs are getting printed correctly.
So later, I am passing it to the custom action Output Variable called "objectValue" (type object). Now after publishing this custom action. If I try to access this object in flow designer (outside of the custom action) using Log statements. Then the object is getting printed like [Object object], but if I use JSON.stringify() method and print it.. it is just returning empty "{}" without any key-value pairs. Even if I try to access keys and values using methods like Object.keys(object_value), but it is still returning nothing.
Please help me with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2025 11:52 PM
very difficult to visualize without screenshots.
If your custom flow action is working fine then when you use that in flow or subflow it should work fine ideally
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2025 12:31 AM
Hi @Ankur Bawiskar ,
Below is the screenshot of log step that I have added in the flow after the custom action step. And I am taking this object_value from custom action step.
the object value is getting printed like [object Object]. But If I try to print it by converting to JSON, then it is returning just "{}". Example:
What could be the reason?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2025 01:00 AM
where is object_value defined?
you should use fd_data.<actionStep>.<output variable> in your log step to get the value
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2025 01:02 AM
Yes @Ankur Bawiskar , I have taken like that only, just not there in the screenshot. Any other possible reason for this?
