Close page event

I made a temp thing hold a pics shows on a repeating group in a page
I need when the user close this page or go to another page , this temp this to be deleted
I only found an event for Page load , there is no event for page closed

One way to do this would be to add some custom JS to the page that looks for a close page event. Pass that data to Bubble and have it trigger a workflow. In the workflow, set an API workflow to delete the temp item. There may be a risk this doesn’t finish before the page is closed though.

You could always run a cron job every so often and check if the user is on the page and if not then delete it, but that would take a whole lot more server processing time.

Anyone else have ideas?

If you want your temp thing to be “empty” (or deleted) when users go to that page, on page load workflow you could look to see if there’s a value in your temp thing and if there is, delete it. That way whenever the page is loaded, you effectively won’t have a temp thing when the user starts interacting with your page.

For second scenario when user goes to another page (a workflow step, ie due to button pressed or some other action/condition), add a step to delete the the temp thing before going to that other page.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.