Grouped Actions ignoring individual action conditions

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?

Its running both actions each time.
Screenshot 2024-05-04 at 2.42.55โ€ฏPM.pngScreenshot 2024-05-04 at 2.43.07โ€ฏPM.pngScreenshot 2024-05-04 at 2.43.25โ€ฏPM.pngScreenshot 2024-05-04 at 2.43.29โ€ฏPM.png

 

Solved Solved
0 8 157
1 ACCEPTED SOLUTION

Using the approach of a status column an automation to delete provided the function needed.

View solution in original post

8 REPLIES 8

Hello there,

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.

I have a Facility table & a userbookmark table with a security filter. 
The actions are in the facility table.

Here is the condition to evaluate whether to run the action that would add the facility to the user bookmark table. 

 

ISBLANK(
FILTER(
"1_UserBookmarks",
[CCN] = [_THISROW].[CMS Certification Number]
)
)

 


Here is what it writes.Screenshot 2024-05-04 at 3.59.08โ€ฏPM.png

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.

 

FILTER(
  "1_UserBookmarks",
  [CCN] = [_THISROW].[CMS Certification Number]
)

 

The CMS Certification Number is the key column of the Facility table and is looking for that match in the userbookmark table in column CCN.

Screenshot 2024-05-04 at 4.12.02โ€ฏPM.png

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:

https://support.google.com/appsheet/answer/10106510?hl=en

https://support.google.com/appsheet/answer/10107396?hl=en

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:


@lochtefeldm wrote:

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.

 

FILTER(
  "1_UserBookmarks",
  [CCN] = [_THISROW].[CMS Certification Number]
)

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.

The order of the action matters.

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. 


 

 

AND(
    ISBLANK([Related 1_UserBookmarks]),
    OR(
        ISBLANK([Related 1_UserBookmarks][LastActionTimestamp]),
        NOW() - ANY(SELECT([Related 1_UserBookmarks][LastActionTimestamp], TRUE)) > "000:00:05"
    )
)

 

 

Maybe this approach wont work and I will have to add a bookmark status column and then set up an automation that deletes rows with a status of delete. 

Using the approach of a status column an automation to delete provided the function needed.

Top Labels in this Space