Portals – Prompt User to Save Before Leaving Page

I’m working on an Appian Portal where clients fill out survey details.
Requirement: if a user tries to Alt+Tab, refresh, close the browser, or navigate away without saving, we want to show a warning message so they don’t lose entered data.

Has anyone implemented this before?
I’m currently tracking unsaved changes with a local flag, and I’m exploring using a!webContentField() to inject JavaScript (beforeunload event) to display the browser’s native confirmation prompt.

Looking for best practices or recommendations on:

  • Reliable way to trigger warnings in Portals.

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data