Remove users from map after 5 minutes or more

I currently have users on a map, set with a user field called Active set to Yes/No.
Those active users show on map.
However I need a button which will let the user select how long they wish to be shown on the map.

For example if a user selects 5 minute sessions, then they will be shown on the map for only 5 minutes. And if another user selects 10 minute sessions then they will be shown on the map for only 10 minutes.

How can this be achieved?

you can change the active state of use with a Schedule Backend API call, giving the time duration dynamically that which user wants.

after that time duration, that Workflow gets called and it set the active to NO. thus user stop being shown on the map.

Hope this solves the issue. :smiley:

Is that something available only to Bubble’s paid users?

I fail to see that option in the workflow of the button.

Yes it is, but you can do a schedule workflow on frontend but it will stop as user move away from page.

Do you mean that a free user can still do it?
What do you mean that it will not stop as user move away from page?

First i apologies as i make a typo, the will not run if userove away from page.

2ndly yes, a free user can do it. It will consuming WUs with bubble new pricesing specially.

Is there no other way to do this?

Can we force the user to be logged out after 5 minutes and hence it would automatically be removed from map?

Or can I add a condition that a user field in the database is only set to yes after 5 minutes a button is clicked?

Also, could we not simply kill the user and smash their phone? That would also effectively remove them from the map! I think.

1 Like

I’d have a value set for the user (say hiddenTime) which is current time + Interval (which is the value the user sets 5 mins, 10 mins etc) then you use a conditional to hide the element once the current time is > hiddenTime

I use this to display a graphic (or hide it) when user details are modified in one app as per below

Of course if you are feeling sassy you could take @keith 's advice and Hulk smash everything in disgust at the the recent pricing changes but you might lose users that way :smiley:

Thanks for the suggestion. I’m still trying to wrap my head on how this can be done. I feel like I will have to upgrade if I want a robust solution.

I don’t know if @keith was trying to help or he is a ChatGPT API integration with the prompt “reply something sassy to users”.

No need for API’s here and no need to upgrade, this is just a simple timestamp action attached to a user. When a map is shown you are doing a calculation on the timestamp plus the users display interval and either hiding the user or making them visible.

Is your suggestion valid even if the user clear’s cache or signs out before the 5 minutes end?
It seems it will only work if the user’s browser is open.

Yes, even if they sign out the value attached to the user is still there for others to see.

You would need to set up permissions for others to be able to see the username and the hiddenTime field assuming you have privacy rules applied to your Users table (which you should have)

I think this cannot work because you are trying to hide an element, while I am trying to hide a marker on the map. I don’t see how I can add a conditional to a user’s marker on the map.