How to loop through checkboxes and create a comma separated string with the values

heathers_
Kilo Sage

Hello. We have a catalog item for users to request access using checkbox variables. The user can select one checkbox or multiple. 

 

The requirement is to send the label/name of the selected checkboxes in a comma separated string in an existing REST API.

 

My challenge is around arrays. How do I loop through the checkboxes that were selected to create a single comma separated list?

Example 1: Both checkboxes were selected, the string value should be "AuditBoard,BOX"

heathers__0-1724166902604.png

Example 2: One checkbox was selected, the string value should be "BOX"

heathers__1-1724167021322.png

Thank you for your help.