cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert entire DataTable column into a string?

IrinaMihalache
Level 2
Hello,

I have an Excel file with 2000+ rows and it containing a column "Email Address". I have to concatenate all rows on that column, put a ";" between them and then paste that huge string into a "TO" field and send an email.

I tried looping throw all rows one by one and create that huge string but it takes too much time. Is there any solution for this, without using the Loop?
(TEXTJOIN and CONCAT functions from Excel apparently limit the numbers of values/characters you can merge, so for my 2000+ rows excel column it's not working)


Email Address
----------------
email 1
email 2
email 3
email 4
.
.
.
email 2000

Wanted result: "email 1; email 2; email 3; email 4;.........;email 2000"
1 REPLY 1

ewilson
Staff
Staff
Hi @IrinaMihalache,

One option would be to get the column of email addresses as a Collection and then use the Join Text action of the Utility - Strings VBO to concatenate them all together. You may have to throw in a call to the Utility - Collection Manipulation's Rename Field action though. The reason for that is the Join Text action expects the input Collection to contain a field named Input Value.

I've attached a very rudimentary example process. This example assumes you're getting the collection of emails from an spreadsheet titled Emails.xlsx in the C:\temp folder. It also expecting a column header of Email. You can, of course, change all those.

Cheers,
Eric