I'd like to display a "Do you want to leave this site?" alert

I am not familiar with any Retool way to do this. But I do know there is a general browser way to do this as I have seen it done, though never done it myself.

I have no specific advice other than get your Google-fu on. Hopefully there is some JS that does it and Retool's sandbox does not defeat it.

You will also need to track if your data is "dirty" (changes but unsaved) so you know when it is appropriate to alert the user. Search this forum for some ways others have solved this.

2 Likes