cancel
Showing results for 
Search instead for 
Did you mean: 

writing collection values in one dataitem

RoshiniSyed
Level 4
Hello,

I need to write the collection values in one data Item. I can write 1st record however after I write the second record in it, it overwrites the 1st one.

This is my collection which had 2 columns and rows are dynamic.
15277.png
I need these data in single data item.

Is there any way to achieve this?

------------------------------
Roshini Syed
------------------------------
2 REPLIES 2

Hi Roshini,

You can do it this way, lets say the data item where you need to write the data is called as 'Results'  and the collection name from where the data needs to be written is called 'Coll' so you can use a decision stage first and check if 'Results' data item is blank or not by using the conditional expression as: [Results] = ""

Now, the condition is true you can use a calculation stage and set the value of 'Results' data item as [Coll.Process] & " , " & [Coll.Status]

If the the condition is false you can use a calculation stage and set the value of 'Results' data item as [Results] & NewLine() & [Coll.Process] & " , " & [Coll.Status]

This logic will write the data in your 'Results' data item as follows:

Interactive Microsevice Co.. , Degraded
VizQl Server , Error​


------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

PabloSarabia
Level 11
Hi @Roshini Syed

Another way is use ​the action "Get Collection as CSV" from the Utility - Strings VBO. This gives you a complete data item with all the lines. Then you can use the "Split Lines" action from the "Utility - Strings" VBO to get a collection with all the lines.

Then you can make a loop with the final collection to get the value and overwrite the Data Item.

With this solution, if you add any column to the first Collection, it will automatically be added to the final concatenated line without having to touch anything.


Hope this helps you!

See you in the Community, bye 🙂

------------------------------
Pablo Sarabia
Solution Manager & Architect
Altamira Assets Management
Madrid
------------------------------