- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 10:50 PM
My scripting knowledge is scant at best but I need help.
I have a Catalog Request with these checkboxes.
I want the ones that are check to show in the description of the task. However when I use the data pill picker because it's only true/false it only displays true or false.
My current work around is to manually write each checkbox label out and then use the data pill picker to mark them as true or false
As you can see it looks pretty clunky.
Is there a way to make it so that only if checkbox is true then just the label for the checkbox displays?
I have tried for 8 hours and I'm at my wit's end.
I don't know if I should be using this function in flow designer
or maybe using the catalog client script
If anyone could help I would be so grateful because I've invested 8 hours and I can't get anything to work.
Any help would be most welcome
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 12:05 AM
If you want to go for a scripted solution, I would suggest creating a small script in the “Update Record” Action in the Flow Designer. This script will run server side in contrast to the client script on the Catalog Item (small performance and security implications).
var description = "";
var option_a = fd_data.trigger.request_item.variables.option_a;
var option_b = fd_data.trigger.request_item.variables.option_b;
var option_c = fd_data.trigger.request_item.variables.option_c;
if (option_a=="true"){
description +=fd_data.trigger.request_item.variables.option_a.getLabel()+"\n";
}
if (option_b=="true"){
description +=fd_data.trigger.request_item.variables.option_b.getLabel()+"\n";
}
if (option_c=="true"){
description +=fd_data.trigger.request_item.variables.option_c.getLabel();
}
return description;
I hope this helped!
Greetings,
Sören
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 07:51 PM
Hi Mahendra and fellows,
I am now able to display the checkboxes via the flow designer script above.
But, I also have reference fields using the sysid table, also multiple choice fields. Is there a way to script those into the email as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 10:06 PM
How can I combine reference, multiple choice and checkbox fields together via flow designer script? This is what I have and it does not generate an email.
var shortDescription = [];
var ritmVariables = fd_data.trigger.request_item.variables;
for (var variable in ritmVariables) {
var variableType = ritmvariables[variable].getQuestion().type || ritmVariables[variable].getDisplayValue() != "" || ritmVariables[variable].toString != "";
if (ritmVariables[variable] == "true") {
shortDescription.push(ritmVariables[variable].getLabel() + ritmVariables[variable].getDisplayValue());
}
}
return shortDescription.join("\n");