Save date more than once with microflow

0
I try to save a dataset five times to get 5 equal new entries. I made an action button with a microflow and this makes only one entry. simple a loop with intLoop=5 at start and decreasing with the same action.. What is necesarry to store the content five times?  
asked
6 answers
0

You don’t need to commit the original address (unless you want to). Instead, just create new Address objects and add those to the AddressList. In the Create Address action you will need to copy the attributes from your original Address object into the new object. Outside the loop you commit the AddressList.

 


There is a Clone and Deepclone action in the Community Commons module that can help copy the attributes, but if you are unsure of how these work, you will probably find it easier to manually copy the values.

I hope this makes sense.

answered
1

You are committing the same object multiple times. This won’t create a new entry in the database, just update the same entry.

In your loop, you will need to use a Create action to create a new object and commit that.

As Ruud mentions in his answer, it is best practice to create a List first, and in the loop create the new objects and add them to the list before committing the list when the loop finishes.

I hope this helps to explain what is happening and how to fix it to get the result you need.

Good luck!

answered
0

Before merge, create a list of type Adresse

After the merge action, create a new object Adresse and add to list. 

When intLoop > 1 returns false, commit the list

You can also use a while loop activity

answered
0

Thanks for your help.

If i create a new object, add it to the list (and commit the list this in a loop) i get x new entries but empty.

If i commit the object i get one entry with the data.

How can i commit the data and store this x-times in a list to comit the list?

 

i played a little with all th epossibilities but don’t know how to store the last commit?

hope you understand ;-)

answered
0

i have to commit the object (Adresse) first to get the last input from the user.

This last input from the user should be saved x times.

As soon as i commit the object i lose its content for any lists adding

So perhaps i miss something but it doensn’t work yet..

answered
0

Yes! That makes it clear! thanks a lot!

answered