Checkboxes and Data Grids

Don Roach shared this question 5 years ago
Answered

I'm trying to simulate adding email addresses from a Contact List (datagrid) to an "Recipient List" input field. (see image)


I followed this tutorial on radio buttons in data rows,


(http://tinyurl.com/a32pvjy)


but it REPLACES the the value in the target input field with the selected value from the datagrid.


How can I DISPLAY ADDITIONAL VALUES from a datagrid value to an existing value in a target input field?


5ad466add1ecdf98e424ad10b13e7821

Comments (5)

photo
1

I've achieved the desired result using "Concat" Function like this (see image)


71a08e687a6c9ff61907880a4a0dd932


Now my question is:


How do I get email addresses to disappear from the target input field when the checkboxes are unchecked?

photo
1

This is what I would do:


First create a variable, in my case I named it "email addresses". Then define the interactions that will be triggered when the checkbox value change. The interactions should look similar to:


Interaction1:


when (checkbox is checked)


set value ("email addresses" variable 'Data+' Select(Row, "Email" attribute) ) on "email addresses" variable


else


set value ("email addresses" variable 'Data-' Select(Row, "Email" attribute) )


on "email addresses" variable


Interaction2:


set value ("email addresses" variable) on input field.


You can find the 'Data+' and 'Data-' functions into the expression builder on the Collections tab of the Functions section.

photo
1

Thanks Carles!


This works like a charm - perfect!


One additional question:


This approach puts a comma before each email address and there are no spaces between each address.


How can I:


1. Remove the comma from in front of the first email address?


2. Add spaces between the email addresses?


a5c2312407d399688822ada25943bfe2


Thanks again for all your help!


D

photo
1

The comma can be removed easily if you use the substring function. However if you want to add the spaces between the email addresses then the prototype will be more complex and you'll need to change all the interactions I suggested you.


Here you have an example of how you can accomplish it.

photo
1

Perfect! Works like a charm.


Thanks, Carles!


D