I’m trying to use a group action to flag a or remove bookmarks and with the add or remove action running conditionally depending on a bookmark record existing or not… but appsheet isn’t respecting the conditions for each individual action in the grouped action. Is this not supported or is my execution flawed?
AppSheet first checks the condition for the grouped action, and then the conditions for each individual action, so there must be something wrong in the expressions for the conditions of those actions.
I can’t tell if the expression you’ve shared is correct without knowing about the columns of the table it runs on.
Here is the expression to check if the facility is in the bookmarks and if so then runs the delete action, deleting the record from the userbookmark table.
If you’re looking for the key column of the Facilities table in the UserBookmarks table it sure sounds like you could get this done a lot easier if you used REFs and REF expressions:
You could just do a ISBLANK([Related UserBookmarks]) for checking if there are existing entries, [Related UserBookmarks] for listing the list of the ID’s already existing.
Also:
The result of this expression is a list of keys, not a TRUE or FALSE which is what you need a condition to output
Well i marked this solved too soon, i changed to using Refs and changed my condition statements to ISBLANK([Related 1_UserBookmarks]) & ISNOTBLANK([Related 1_UserBookmarks]). Both actions are still triggering at the same time though.
tried adding a timestamp condition for last action of 5 seconds too, still fires off both actions…
Your Delete action is of the type to execute an action on a set of rows, and that action is the “Delete” action in the bookmarks table, correct?
The problem with your conditions are that if the actions are run sequentially the following will happen:
If you had a bookmark saved when triggering the action, it would be deleted, but then it would be added again since the condition that adds it sees that there’s no bookmark
If you had no bookmark, if wouldn’t be deleted since there isn’t anything, and then it would be added.
Try moving the ADD action first, and adding a condition to the remove action that checks if the datetime in which the bookmark was created is different to NOW(), and if it is, then delete it.
I’m not 100% sure if AppSheet would recalculate the NOW() expression between 2 actions of the same grouped action, but it’s worth a try
Correct. I have tried both add 1st in the grouping and remove 1st in the grouping, still doesnt resolve. Here is the now() function i tried as a condition that didnt work.