The CreatorCon Call for Content is officially open! Get started here.

Using Subflow output variable in flow

TT3
Kilo Guru

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".

2 REPLIES 2

AnubhavRitolia
Mega Sage

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.

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

Kenneth Zabrisk
Tera Guru

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?