I’m trying to figure out how to use checkboxes in repeating groups to selected users to add to a data field that has a list of users. I’m getting stuck when trying to set the team member list. Any suggestions?
Create a custom state on the page something like “usersToAdd”, make it of type user and make it a list.
Add a workflow that says when the checkbox is checked add current cell’s user to the custom state only when the user isn’t in the custom state.
Add another that removes it if the user is in the custom state.
Then for your set list you can use the custom state.
I’m getting lost on making it a list when creating a custom state. The Custom state type is set to user. Does the "This state is a list (multiple entries) need to be selected?
I’ve tried adding the user’s to the list but it doesn’t seem to be working. See anything else I’m missing?
Team Member add list [and then your custom state]… (not the RG).
Lets walk through whats happening here:
You’re using the custom state to hold the selected users as a list, like an array from the old world.
Then when the user clicks save, you can save the list/array to the record.
Here’s another useful tip:
While you are going through the development and trouble shooting, it’s always useful to display your elements on the screen that are doing your work for you in the background… in this case the custom state “selected”.
If you put that within a text element and have set the plus/minus steps correctly, you should see the users getting added and removed from the custom state.
I’m unable to get the state to show up unless I choose the RG. Are you available for hire for you to show me over a screen share?
Did you manage to get this solved? I am stuck on a somewhat similar issue. I am unable to pre populate the selected checkboxes. I have mentioned it here: How to save multiple choices with checkbox in repeating group?
Thanks Ambroise. I have been able to do this. What I have not been able to do is pre select the checkboxes when the page loads. Say in your example I select Test1 and Test4. Now I want to store this selection in the DB, and next time I visit the page, I want Test1 and Test4 to be pre selected.
I am able to store in the DB, but the condition that I am applying for preselection is not working.
This is how I have put condition for the checkbox:
You don’t need 2 conditions. On the element’s appearance tab, the value for checked or not will be the default. Then use one condition to change to the other value.
Sure, but two conditions won’t hurt, right? I am pretty sure that I started with one, and when that was not working I added another.
Anyway, I have now made a custom checkbox of my own using a repeating group.
@mghatiya then you probably have a field Selected (Yes/No) in your Work Type data type?
In the When Checkbox’s value is changed workflows, add a Make Changes to Current cell’s Work Type action (after the set state action) and define Selected = yes/no depending on whether the checkbox is checked or not
You would then need to set your checkbox as a dynamic value from that very same field
Thanks Ambroise. As I said, for now I have now created my own custom checkbox. Maybe next time.
Thanks for looking into it and helping.
Hi @ambroisedlg I am facing same problem again in a new page where I have a set of checkboxes in a repeating group. It is for pre selecting the chosen days in a week.
I see in debugger that custom states and conditions are being shown correctly, and it even says that this checkbox should be checked, but still they are not checked.
Custom state value for full repeating group of checkboxes:
*Value of conditions and the checkbox:*