How to Combile string variable based on Success Condition


I am trying to make Email Validation Flow that will check if Email address is Invalid or Not.

if Email address is Valid I want to store them in 1 String Variable with separator semi colon “;”

Here is the Excel where I get all the emails.

Here is the structure of my workflow

expected output:;;;

Thank you in advance


You are almost done

Inside the IF activity in THEN block First use a assign activity Inside the IF condition

str_temp = strValidate.ToString

Str_temp is a string variable defined in variable panel which is of type string

Then inside the same THEN block use another assign activity

str_mailid = str_temp + “;”+ str_mailid

Where str_mailid is a string variable defined in Variable panel of type string with default value as String.Empty

Now str_mailid will have all the mail I’d with ; as separator

Hope this would help you resolve this
Cheers @Vincent_Nuestro

Hello @Vincent_Nuestro

Here you go

Below is the workflow for the same:-
Main.xaml (16.8 KB)
Sample.xlsx (9.3 KB)


Mark as a solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

hi @Pratik_Wavhal can i have screenshot instead?
i cant open the file


Hi @Vincent_Nuestro
Did this method help in this scenario

hi @Palaniyappan

no, it only gives me 1 email per loop

Well there is one more option to handle this

Inside the then block use a ADD TO COLLECTIONS activity where mention in property panel as

Collections - list_mailid
Item - strValidate.ToString

Where list_mailid is a variable of type system.Collections.Generic.List(of String) defined in the variable panel with default value as New List(Of String)

after the loop use a assign activity like this

str_finalmailid = String.Join(“;”,list_mailid.ToArray())

A simple approach to solve this

Cheers @Vincent_Nuestro

1 Like

I put the list of String above for each loop

1 Like

Go ahead @Vincent_Nuestro

1 Like

thank you, it works now:) @Palaniyappan

1 Like

Hello @Vincent_Nuestro

Below are the screenshots of the workflow:-

As @Palaniyappan told you the logic which you have now marked as solved, the same I had implemented.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:


hi @Pratik_Wavhal and @Palaniyappan thank you so much for your help :slight_smile:

1 Like

Glad @Vincent_Nuestro
Happy automation

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.