Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Script step output variable value not passing to custom action output variable in Flow Designer

VullankiL
Tera Contributor

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.

10 REPLIES 10

@VullankiL 

You will have to use some scripting to determine if it's empty

If my response helped please mark it correct and close the thread so that it benefits future readers.

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