Skip to main content
Known Participant
May 29, 2025
Answered

Concatenate checkboxes

I have 5 checkboxes "Check Box1-5" that needs to fill in multi-line text field with their export value when any is checked. Any help is appreciated.

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
May 29, 2025

Use this as custom calculation script of text field:

var array = [];
for (var i=1; i<=5; i++) {
 var checkbox = this.getField("Check Box"+i).valueAsString;
 if(checkbox !== "Off")
  array.push(checkbox);}
event.value = array.join("\n");

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
May 29, 2025

Use this as custom calculation script of text field:

var array = [];
for (var i=1; i<=5; i++) {
 var checkbox = this.getField("Check Box"+i).valueAsString;
 if(checkbox !== "Off")
  array.push(checkbox);}
event.value = array.join("\n");
Translate