Using Subflow output variable in flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2022 01:49 PM
See below script written to set values of category field of incident. The incident is getting created using flow and the flow calls suflow to calculate value for category.
var outputCategory = fd_data.subflowIncident.category.toString(); // I also tried withot .toString()
var category = '';
if (outputCategory == 'Teams'){
gs.info('in if'); // This is not getting logged
category = 'teams';
}
gs.info('category = ' + category+ ', from subflow = ' + outputCategory);
// above statement logs: category = , from subflow = Teams
return 'teams';
Any idea why it logs correctly but the condition is not satisfying? Do we have to do any formatting?
FYI: fd_data.subflowIncident refers to a subflow and it returns output variable "category".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 09:23 AM
Hi TT,
I guess Category field in Incident is Choice field. Can you check if the backend value is 'Teams' or 'teams'?
May be Teams is Label and teams is choice name.
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 06:04 AM - edited ‎01-19-2023 06:04 AM
Did you ever resolve this? I have a subflow that is generating a value, but that value is not being passed to the flow. In my case it is simple a text string being written to a text field, so formatting should not be an issue?