Hello, I am trying to create a select all/ deselect all feature that sends to the database.
I already created the select all/ deselect all feature, but it does not correctly send to the database. Ideally, I would be able to press the select all button and then deselect a couple of options and then send that to the database.
I thought I read somewhere that I need to create an event that adds/ removes each option individually.
Thanks.
Do you want the database to be updated as and when each item is selected/deselectedâŚ
Or only once another button has been clicked to confirm the selection?
I have a long form, where the user would fill it out and at the bottom I have a âsubmit programâ button, so I have a button at the end of the page where I submit the data to the database as well as multiple âselect all/ deselect allâ for different fields.
In that case all you need to do is set the relevant list fields to the selected items, using âset listââŚ
1 Like
Assuming that the âselect all/deselect allâ functionality that youâve already built works using a custom state list field of âselected options,â you are correct that youâll have to also add the functionality to individually add / remove single options from this list.
Create a workflow by right clicking on the checkbox and selecting âstart/edit workflow.â This will take you to the workflow tab with the event âwhen checkboxâs value is changed.â Youâll need to create two versions of this workflow event with conflicting conditions:
- Only when this checkbox is checked
- Only when this checkbox isnât checked
The status of the checkbox in the only when condition represents its value AFTER the change is made, so saying âonly when this checkbox is checkedâ is saying âonly when it goes from an unchecked state to a checked stateâ and saying âonly when this checkbox isnât checkedâ is saying the opposite.
Those workflows should have actions that add/remove the checkboxâs item from the list, using the âset stateâ action to reference the existing list, and then the âminus itemâ or âplus itemâ operator to add or remove a single option.
Thanks for your help Sam! This solved it for me!