cancel
Showing results for 
Search instead for 
Did you mean: 

Collection all rows data Move everything onto one single line with comma separator

Murali_MohanKon
Level 4
Hi Team, I have data in collection, Collection all rows data Move everything onto one single line with comma separator. please find below attachment. Please share your ideas .Thanks in advance.   Thanks  Murali Mohan
3 REPLIES 3

AndreyKudinov
Level 10
Loop over collection and concatenate (with calculate stage). If this obvious solution doesn't work for you - explain why. 

BellaKoh
Level 3
There is a default Utility - Strings VBO object in BluePrism. Use the 'Join Text' function to concatenate all values in a collection into a string.

Anonymous
Not applicable
Hi there Bellaksl,  You should be able to achieve this relatively easily with a code stage.  Incorporate something similar to the below, using an incoming DataTable (your collection) and outgoing String (your comma separated text value):  [Outgoing Comma Separated String] = String.Empty Dim intCounter As Int32 = 0 While intCounter < [Incoming DataTable].Rows.Count If intCounter > 0 Then [Outgoing Comma Separated String] += "", "" End If [Outgoing Comma Separated String] += String.Join("", "", [Incoming DataTable].Rows(intCounter).ItemArray) intCounter += 1 End While The above will:  Set our outgoing String to nothing  Initialise our counter to 0 Iterate through each row in our incoming DataTable  If we are not on the first row, add a comma, otherwise continue  Add each DataRow value to our outgoing String with a comma separating  Increment our counter  End iteration  You can see it running via this link.  Keep in mind the majority of this is constructing a DataTable, which you will not require! ALSO, there is no validation or handling included - most likely, you will want to validate the incoming DataTable is initialised and populated accordingly.  Thanks in advance and good luck,  Josh