- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 08:07 AM
Hi everyone,
I created a subflow that returns a JSON but it doesn't recognize it in the main flow.
I've changed the output to string type, but it doesn't seem to work. Any ideas?
Thank you very much, and best regards.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 08:27 AM
I could see you are grabbing flow_var which means flow variable and not subflow output
Things to check
1) did the subflow gave correct json string as output when flow executed?
2) ensure subflow has output of type string and not JSON
3) did you use correct subflow output variable name in your script?
It should be something like this
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
07-31-2025 08:16 AM - edited 07-31-2025 08:22 AM
Could be a couple of things.
Based on you screen shots fd_data.flow_variable.output_validation may not be valid. Verify the name of the flow variable.
It appears based on your output that you may not be formatting the output properly for what you are trying to do. Try formatting the output as an array of objects by enclosing it in brackets []. This may then require a change to the code in order to retrieve u_resolution_code_category.
var rcc = JSON.parse(fd_data.flow_var.output_validation);
if (rcc[0].u_resolution_code_category)
return rcc[0].u_resolution_code_category;
else
return '';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 08:27 AM
I could see you are grabbing flow_var which means flow variable and not subflow output
Things to check
1) did the subflow gave correct json string as output when flow executed?
2) ensure subflow has output of type string and not JSON
3) did you use correct subflow output variable name in your script?
It should be something like this
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
07-31-2025 08:50 PM
Hope you are doing good.
Did my reply answer your question?
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