square-beach-57324
07/21/2023, 8:25 AMhttps://cdn.discordapp.com/attachments/1131864480607916104/1131864480805040189/screencapture-studio-botpress-cloud-c9249635-c2cc-4456-931b-517f9fb6f101-flows-wf-main-2023-07-21-09_10_28.png▾
acceptable-kangaroo-64719
07/21/2023, 12:27 PMjs
const variables = [workflow.forPhisio, workflow.forCounselling,... ]; //Put all your vars here
// Use lodash to filter non-blank variables and append them to a new variable
const finalMsg = _.reduce(variables, (acc, val) => {
if (_.trim(val) !== '') {
acc += val + ' ';
}
return acc;
}, '');
workflow.finalMsg = finalMsg.trim();
Then instead of putting all your vars in the text card, you can just put @finalMsg
insteadsquare-beach-57324
07/25/2023, 6:52 AM