Saving the List Data to Database
Question

On Saving Append List Data into database table , it makes call to create server action multiple times i.e (generates multiple request to server ), how do i save record and  making multiple server  to server ?

Solution

Check again on the OML that I am sharing.

what I did was create another server action

And I called here instead of having the for each on client-side calling multiple times a server action

MyFile.oml

Hello!!

So, do you want to make just one call to avoid all those warnings to the server?

For that, you should create a server action and you can loop your list in that server action and add every record from that list to the database by calling the entity action to save.

It seems there is a question already,  the same question...

https://www.outsystems.com/forums/discussion/75193/saving-the-list-data-into-database/

https://www.outsystems.com/forums/discussion/61587/how-to-save-the-data-from-a-listappend-to-a-table-in-the-database/

For example, I have a list, it can be from a variable with a list or from an aggregate, the important here is to pass the list to the server action that will loop your list.

You will need to create a server action where you are going to use a for each that will loop you list, on the for each you also call the entity action, in this case mine was the CreateOrUpdateLine

You pass the list that you want to loop

And you also pass the current record to add

Then you call your server action to the save client action and you pass your list that you want to save.


@Márcio Carvalho Please refer myFile app and  module(DemoList) and provide solution according , I have created the server action .

still getting the warning of multiple request .Please check


MyFile.oml

Solution

Check again on the OML that I am sharing.

what I did was create another server action

And I called here instead of having the for each on client-side calling multiple times a server action

MyFile.oml

Márcio Carvalho  Thanks man


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