Adding Rows to Collection

APatel

New Member
Hello,

I have number of rows that I want to add to collection. I am using multi-calc stage which has 10 entries that I want to add to collection. I am also using "Add Row" from collection VBO but that only adds 1 row to collection so when the process runs, it replaces each entry and at the end only the last entry from multi-calc is available in collection.
I can add 10 Add Row action stages and split the 10 entries using single calc stage but that will create a big process model which I do not really want.

Can you please recommend any other way I can get this working?

Thank you
 

Alena Ulas

New Member
Hello.

Perhaps, in this case, a cycle with the condition of stopping upon reaching the desired number of iterations is suitable.

Then the number of elements will not depend on the number of rows that need to be added to the collection.
 

gil.silva

Active Member
Hello APatel,

The rows that you mentioned are in another collection? If so, you can use the action 'Append Rows to Collection'.

Let me know if you need more assistance.
 

APatel

New Member
Hello.

Perhaps, in this case, a cycle with the condition of stopping upon reaching the desired number of iterations is suitable.

Then the number of elements will not depend on the number of rows that need to be added to the collection.

-------------------------------------------------------------
Hello, Thank you for your response.
I tried it this way and it adds 12 rows to collection but only the 12th row gets filled with values. The rows 1 to 11 in collection are empty.
 

APatel

New Member
Hello APatel,

The rows that you mentioned are in another collection? If so, you can use the action 'Append Rows to Collection'.

Let me know if you need more assistance.

Hello,

Thank you for your response.
I tried "Append Rows to collection", but I am still not getting the result I want.
 

Alena Ulas

New Member
APatel,

If you have a collection in the source data, but you cannot append it, a possible option is to go through it in a loop, add new lines to the collection for recording, and write the value of the current line of the old collection to the current line of the new collection.

If your source data is 10 different variables, it may be more appropriate to replace them with a single-line collection, where each field is actually a separate variable. Then it can be transposed (Transpose Collection), and do the same by overwriting in a new collection in a loop.

Hope this helps you.
 

gil.silva

Active Member
And why you're not getting the result you want?

Can you post a screenshot with the logic?
With the Append Rows, you don't need a Loop.
 

APatel

New Member
And why you're not getting the result you want?

Can you post a screenshot with the logic?
With the Append Rows, you don't need a Loop.

So I need to first figure out how to write multi-calc stage with 10 rows into a new collection. At the end I am able to add 10 rows to new collection but first 1-9 rows are empty and only last row has 10th row filled in. so the question is how to get new collection with all 10 rows filled with right values.
 

gil.silva

Active Member
You have the 10 rows in a collection.
You just need to use the action 'Append Rows to Collection', where your 'Collection to Append' is the collection with the 10 rows, your Main Collection is the...main collection and Output also the Main Collection or a new one.
 

APatel

New Member
You have the 10 rows in a collection.
You just need to use the action 'Append Rows to Collection', where your 'Collection to Append' is the collection with the 10 rows, your Main Collection is the...main collection and Output also the Main Collection or a new one.

I do not have the 10 rows in collection yet. I am trying to add those 10 rows into collection using multi calc stage. but only the last row gets added at the end to the collection. Even if I add 10 rows using the count before, the first 9 rows are blank and the last one gets filled with 10th row data.
 

APatel

New Member
You have the 10 rows in a collection.
You just need to use the action 'Append Rows to Collection', where your 'Collection to Append' is the collection with the 10 rows, your Main Collection is the...main collection and Output also the Main Collection or a new one.

Please See the attached file
 

Attachments

  • BP1.png
    11.3 KB · Views: 225
  • BP2.PNG
    5.7 KB · Views: 192
  • BP3.PNG
    4.4 KB · Views: 174
Top