Split the values of two variables and assign them

Hi All,

Im stuck near a logic and unable to retrieve the values from it. Below is the place where i need help.

ColVal1= “a,b,c”
ColVal2 = “1,2,3”

so my output should be a= 1, b=2 , c=3

Thanks in Advance.


  1. Use assign activity to initialize the values of variables

  2. Use Split to split the string and store that split values into an array type variable

  3. And just use message box or else anything to print the output

Hope this will help you


In a later point i want to add one more values to the ColVal1 and ColVal2. , i.e., ColVal1=“a,b,c,d” and
ColVal2=“1,2,3,4” . I should change the code again, but in my case i dont want to change the code for every variable which is gets added to the ColVal1 and ColVal2 ?

@ppratz Here is your solution

dummy4.xaml (8.6 KB)

Hope this will help you



Do you want to get result as single string variable? If so, the following will work.

result = String.Join(",",colVal1.Split({","c}).Select(function(x,i) x+"="+colVal2.Split({","c})(i)).toArray)

If you want to correlate with each value, perhaps you should use dictionary as the following.

dict = colVal1.Split(","c).Zip(colVal2.Split(","c ), Function(k,v) New With {k,v}).ToDictionary(Function(a) a.k, Function(a) a.v)

Then dict(“a”) returns 1, dict(“b”) returns 2 etc…

note: dict is Dictionary(Of string, string) type


Hi @ppratz

Below is the workflow for the same :-
MainPratik.xaml (10.6 KB)

Output :-


This workflow will run with any count of Character present in the String.

For Eg :-

  1. ColVal1=“a,b,c”
  2. ColVal1=“a,b,c,d”

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

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

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