Automatically show buttons or views AFTER updates applied

I’m sure others already know about this but if it has been posted about I didn’t find it. Even so, it is probably a worthwhile mention again.

This idea may have holes in it but I wanted to get it published while I can.


At times, based on how we have our Sync properties set (see NOTE below), we may need for certain abilities within the app to be delayed until recent updates are applied.

NOTE: This does assume you have the “Delayed Sync” and “Automatic Updates” properties switched on in your app. Otherwise, you are probably not experiencing the issue this tip is trying to resolve.

Example Use Case

For example, I am currently building functionality that requires interaction between two apps and use buttons to navigate between the two. If I apply changes and then immediately click a button to switch to the other app, there is potential for the updates to be dropped and never applied.

BUT, with this discovery, I can hide that button until the updates have completed.

How to Implement

The trick here is to base the showing of the button (or other visual component) on a timestamp established at the time the row was saved.

In an entry Form, “Initial Value” likely will not work because that value is established when the Form is opened and the Form can be opened for any duration of time. Meaning, the “Initial Value” could be long past and the visual element you are trying to hide will show immediately anyway.

In these cases, I am using an action on Form Save to set my timestamp at save time.

With an appropriate updated timestamp column in the data, the Behavior or Show_If criteria, that controls hide/show of the visual element, can now be set using an expression like:

NOW() > [The Timestamp]+"000:00:01"

You can, of course, combine this with any other criteria needed. And depending on your app performance, you may need to increase the duration value a little.

How it works

When a related data update is made, the expression is evaluated and because the criteria to show the item is based on a future timeframe, the item remains hidden. Once the updates are completed, a Sync is performed and the expression is evaluated again. The criterion time is past and the element is now shown.

Additional Observations

This trick can probably be extended to apply to other functions within the app. It can also be used for hiding visual elements after the updates EXCEPT the active view. Unfortunately, when a view is the active view it will remain visible, even if the display criteria hides it, until the user has clicked away from that view.

8 Likes

I’m doing something similar but backwards. A button that is only displayed for 5min after making a choice - forcing you to re-choose if you manage to navigate all the way back by accident (they aren’t supposed to be able to, but you know how users can be).

3 Likes

So you need to hit the Sync Button? Maybe you could post a GIF?

No. The Sync happens automatically due to some change such as Save on a Form or entry of a Quick Edit field. The ide is that any buttons after that change can be hidden with the expression similar to the post above. When saves/updates complete, the normal background sync is automatically performed and the buttons criteria will be re-evaluated. Because Time would then meet the buttons constraint, the button will be shown - effectively hiding the button or buttons until after the updates have been applied.

If I can find some time I’ll try to add a video.

1 Like