Skip to main content
varunb579494
May 25, 2022
Question

Is it possible to save into database without leaving the form?

  • May 25, 2022
  • 6 replies
  • 1 view

I know about a!writetodatastore smart service function, is it possible that without navigating away from interface we are able to save the data in database using that function or is there some other way around.

6 replies

stewart.burchell
May 25, 2022

Yes. You can trigger the a!writetodatastore() within an saveInto on a user interface input component. The associated documentation for this function is pretty clear.

varunb579494
July 6, 2022

Thanks [mention:7628077af4b9463e9533a897fad2351f:e9ed411860ed4f2ba0265705b8793d05] that's working good.

mikes0011
Brainy
May 25, 2022

Can you tell us more about your use case?

As Stewart mentioned, the a!writeToDataStoreEntity()* function writes to the DB upon the execution of any save action, so it might be helpful for you to describe what you want to accomplish, what you've tried already, and what you're having issues with.

The Expression Guru
varunb579494
July 6, 2022

The form had two buttons, Save for Later and Submit. On Save For Later, user didn't want to navigate away from UI. The form is divided into multiple parts for being a huge form. Every part has "Save for Later" which we wanted to save data in DB without navigating away.

csteward
July 6, 2022

To note, a trick you can use when you need to navigate away temporarily, such as uploading a document, saving data (with the Write to Datastore service), you can submit the form and chain through these other services, chain back to the form and it will appear to the user that they never left.  With something such as wizard type interfaces you can pass a reference back in as to where the user was viewing and re-load that section on return.

Otherwise, the a!writeToDataStoreEntity() services works well when you can apply it within a save action.