Help me with my help gmail

Hello!
I asked this question in the support:

“I am making a bubble app(a MDT) where you have a you can see all the online users. I do this with a data field in Users called active, which when is “yes” you are online and other people can see that you are also online. But when someone closes the page, Active is still set to yes. So how do i make it it goes to “no” when the page is closed?”

And i got this as a answer:

“One way that you can achieve this functionality is to have a field on the user data type that tracks active status. For example, a “last_active” field that is a date type. Then, you can implement a workflow on the page that works on a “Do every 5 seconds” condition that makes changes to the user’s “last_active” field and updates it with the current date/time. So every 5 seconds, you are updating the timestamp of the “last_active” field with the current date/time.

Then, when you want to change the active field to “no”, you can use the “make changes to a thing” action with a condition that the current date/time - current user’s last_active :seconds > 5. This means that when the difference between the current date/time and the user’s last_active is greater than or equal to 5 seconds, set the user as not active."

But when i close the page, the workflow also stops so i wont check if it is larger than five. Please help!

Maybe schedule it on your backend workflows.

Sorry i am a bit late. I am really bad with backend workflows. Can you maybe help me a bit with how to do it?