Forum Academy Marketplace Showcase Pricing Features

Dynamic text isn't updating based on time?

My app makes some API calls to provide the most recent information to the users. When you click the “update” button (see below), it updates a user filed called “last_updated” to the current time.

Screenshot 2021-08-17 at 07.46.41

I have a text box with a simple current time minus last_updated time formula to show the user when their data was last refreshed.

Screenshot 2021-08-17 at 07.47.36

I was hoping this would mean the calculated value would change automatically based on the current time - i.e. it would change from “updated 2 minutes ago” to “updated 5 minutes ago” as time passes.

However, it appears to only update when the user refreshes the page. Is there any way I can get the values to update in real time without the user having to refresh?

Heya,

I am currently not sure how setting intervals works with existing elements (recurring calls) as I think this is necessary as you want to check the current time every second/minute to be updated. Creating a plugin would help I guess.
Do you know how to create plugins? With that you should be able to use “setInterval” and check for timedifferences which will then be reflected in the state of a plugin field.

Let me know if you need support.

As far as I can tell, the built in Current Date/Time expression only loads a static date/time whenever the expression is used, but doesn’t update in real time.

For ‘real-time’ current date/time try the Current Date/Time plugin by Mintflow - it will let you refer to the current date time which will update in real time.

1 Like

This worked perfectly @adamhholmes - thanks!

1 Like