I have a situation where on button click it currently adds value.id to local storage. I want to prevent duplicate entries that share the same id.
I have tried using the disable function in app connect to disable the button if the id exists in the data store but the closest I can get is to only disable when the id is value[0].id. Any ideas?
Here’s an example of what I’m trying to do. I have a list of values with a button next to each one.
Blue (1)
Red (2)
Green (3)
Orange (4)
Purple (5)
On button click the value and its ID are sent to datastore. However I’m trying to disable the button when for example Green (ID: 3) is added to datastore so it can’t be added twice.
If it’s removed from datastore then the button should be active again.
That will only check the first value in your data store array, any subsequent value won’t get checked for your condition.
The way I check all the values in an array for a condition is by using the formatter in the dynamic data picker (the magic wand). Use the “values” formatter.