How to save input data in database om closing browser
Application Type

Hi Team,

I want to auto-save input data in database on closing browser

Hey Pallavi,

You'll probably need to use JavaScript to detect that the browser is closing and call an action there, using the $actions predefined object.

Here's a forum thread that may help you:

Here's a step-by-step tutorial on how to do it:


Add  below code on your url open button and try this 

var win =$parameters.RedirectionLink,"_blank");

var timer = setInterval(function(){if(win.closed){  


    setTimeout(function CallYourFunction() {

        $actions.CloseAndSaveData() // this is the client action 

    }, 2000);


Hi Pallavi,

Add below JavaScript on onReady event of you screen.

window.addEventListener("beforeunload", function(event){



you can write save data logic in "Saveinputdata" action.

Hope this helps.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.