Auto save data from site page to DB

Certified Associate Developer

Hi All,

We have a requirement where we need to automatically save data to DB from site page if user is not performing any action for defined time.
Please make a note that we looking for a solution which would save data without any user interaction.
Any help is highly appreciated.

Thanks!
Mayur Mondhe

  Discussion posts and replies are publicly visible

Parents
  • The only thing I can think of is to have either a!writeToDataStoreEntity() or a!startProcess() configured into every single saveInto of every single component that a user could fill in on the site. This is cumbersome and a bit messy but you could get it to know everything a user input. Especially using a!startProcess() you could configure something to happen after a certain amount of time after the first input was received.

    I've never had to do something like this but you would have to be careful of the refreshAfter variable (where available). If there's a large text input and someone never unfocuses this solution wouldn't capture that unless refreshAfter was "KEYPRESS". I've never tested anything like this so this suggestion is only an idea.

  • 0
    Certified Lead Developer
    in reply to ajhick

    a!startProcess works only inside a saveInto which reacts on use input only. Same for a!writeToDataStoreEntity().

  • Yes, totally understand this and wasn't suggesting it could work without user input. But if the use case is to know when someone goes to a site, starts entering details and then stops and doesn't submit then a!startProcess and a!writeToDataStoreEntity would work. Obviously this doesn't help if you need to know the moment they go to the site (what if they load the site and goes to lunch and only enters the first details when they return?) or if you need to know when the site is visited and no details are entered. Like in your response we'd need to know the exact use case to know suggest anything further.

Reply
  • Yes, totally understand this and wasn't suggesting it could work without user input. But if the use case is to know when someone goes to a site, starts entering details and then stops and doesn't submit then a!startProcess and a!writeToDataStoreEntity would work. Obviously this doesn't help if you need to know the moment they go to the site (what if they load the site and goes to lunch and only enters the first details when they return?) or if you need to know when the site is visited and no details are entered. Like in your response we'd need to know the exact use case to know suggest anything further.

Children
No Data