How to Insert 1000+ records into Write to datastore Entity at a time

Certified Senior Developer

for example my array size is 3400

in the first write - 1 to 1000
2nd time write 1001 to 2000
3rd time write 2001 to 3000
4th time write 3001 to 3400

How we can achieve this one 

can anyone help me out 

TIA

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    Hi  

    1)If the data to write can be get from the query, you can use looping logic in process model. Have a process variable to hold startIndex and totalCount. Then query the 1000 or I would suggest 500 data then write to Database then Increment the startIndex  and in Xor node check if StartIndex>TotalCount then end the process else continue incrementing do the loop.

    There are different cases based on the filters you apply. Say if query with a filter status =A and then you updated status = B. Then in this case you need to modify loop logic.   The above one is more generic.

    2) if you have a list already from a process or form, then use startIndex and totalCount varaibles in loop as like above

Reply
  • +1
    Certified Senior Developer

    Hi  

    1)If the data to write can be get from the query, you can use looping logic in process model. Have a process variable to hold startIndex and totalCount. Then query the 1000 or I would suggest 500 data then write to Database then Increment the startIndex  and in Xor node check if StartIndex>TotalCount then end the process else continue incrementing do the loop.

    There are different cases based on the filters you apply. Say if query with a filter status =A and then you updated status = B. Then in this case you need to modify loop logic.   The above one is more generic.

    2) if you have a list already from a process or form, then use startIndex and totalCount varaibles in loop as like above

Children