Skip to main content
Known Participant
May 29, 2025
Answered

Concatenate checkboxes

  • May 29, 2025
  • 1 reply
  • 248 views

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.

Correct answer Nesa Nurani

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");