- 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
10-06-2022 11:41 PM - edited 10-06-2022 11:42 PM
Hello,
if you don’t feel comfortable with scripting and want to avoid it you could even build an if else logic in the flow and add your labels to the description. For example: If Option A is true add a certain (hard coded String). The same for Option B and C.
This will definitely become quite big depending on the number of options and the String/Text will be hard coded, but would be a potential “low code” solution.
I hope that helped!
Greetings,
Sören

- 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
10-11-2022 02:54 PM
Hi Soren,
Thanks for getting back so promptly (and apologies for the late reply). This did EXACTLY what I wanted so I was able to use the script and play around with it to get some other bits and bobs in.
Just wanted to say how much I appreciate you giving me the script so I could study and understand it (and get it working)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 12:46 AM
Hello @Brookie
I think you can use something below below on flow designer to populate the checkbox label. You can do this for all your checkbox field.
var shortDescription = [];
if (fd_data._1__get_catalog_variables.acrobat) { // IF acrobat is checked then put Adobe Acrobat label in array
shortDescription.push("Adobe Acrobat");
}
if (fd_data._1__get_catalog_variables.photoshop) { // IF acrobat is checked then put Adobe Acrobat label in array
shortDescription.push("Adobe Photoshop");
}
return shortDescription.join("\n");
OR you can use the below script to get the variable from Requested Item record and populate the Label in short description dynamically
var shortDescription = [];
var ritmVariables = fd_data.trigger.request_item.variables;
for (var variable in ritmVariables) {
var variableType = ritmVariables[variable].getQuestion().type;
if (variableType == 7) {
if (ritmVariables[variable] == "true") {
shortDescription.push(ritmVariables[variable].getLabel());
}
}
}
return shortDescription.join("\n");