Say I have 3 checkboxes with value list Yes and No
1. Name (If value = "1"; table:name; "" )
2. Address = (If value = "1"; table_address; '')
3. Postal Code = (If value = "1"; table_postcode; "")
Now, what is your value list – Yes and No, or 1 and …? (and if it is 1, use 1 – not "1" …)
Suggestion: create a value list with a just a 1 for these Boolean checkboxes; then your calculation could be e.g.:
~l = List (
Case ( useName? ; table:name ) ;
Case ( useAddress? ; table_address ) ;
Case ( usePostcode? ; table_postcode)
Substitute ( ~l ; ¶ ; ", " )
If you want to preserve the click order: create one static value list with the values 1, 2, 3; display it on the layout with just the boxes, not the values, and show a text legend next to it.
Let ( [
~s = yourSelectionCheckBox ;
~l = List ( name ; addressLine ; postCode ) ;
~res = List (
GetValue ( ~l ; GetValue ( ~s ; 1 ) ) ;
GetValue ( ~l ; GetValue ( ~s ; 2 ) ) ;
GetValue ( ~l ; GetValue ( ~s ; 3 ) )
Substitute ( ~res ; ¶ ; ", " )
Simplified version of 2nd calc
Thank you for your reply. I chose the second option of yours. Works like a charm now.
Really do appreciate it and just learning new coding/calculation skills. Remarkable the things that I still can learn.