Custom Action upon screen visit



Hello.

I have implemented the Weather API recall function. I am trying to perform a Custom Action every time users visit the screen, and then use the data to create new weather log to display on the homepage.

However, it seems that this approach doesn’t work. I would appreciate any pointers.

What I am trying to achieve is to have the weather log updated on an hourly basic even the users didn’t do anything.

Hi @disamvn,

As far as I know, Custom Actions’ responses don’t work with on-screen-enter actions.
So it’ll be better to add this action to the button before you enter this screen.

Best regards, Victor.

Hey @Victor ,

Thanks for your reply.

The idea is that I would like the weather data to be refreshed automatically without the users interaction. Is there a trick to achieve this?

Kind regards,

I guess you could do it with a Lottie Animation or a countdown. When it ends, trigger your wheater refresh action

Hi @disamvn,

As I see you’ve set up the weather in the Home screen. So a workaround could be to add a countdown timer with 1 second delay, and run a custom action upon its finish. Then, each time user reopens the app, the data should be refreshed.

Some experiments might be needed with timer hide/show if you’d like to refresh the weather data while browsing the app.

Best regards, Victor.

@Victor thanks, that works like a charm :slight_smile:

1 Like

@disamvn if you would like the countdown to refresh every “x” amount of time even if the user stays on the home page you could clone your home page put a second countdown on the cloned homepage that links you to your main home page (with transition set as : none, so user don’t see anyting ) . This will create a loop and keep your data up to date.