Hi there,
Need help in getting the output as
ABC,Lim
Sammy,Tan
which is FirstName(0)+“,”+LastName(0) and next new line as FirstName(1)+“,”+LastName(1)
But i need the counter to be dynamic cos it can be more than 2
two variables
FirstName = {“ABC”,“Sammy”}
LastName = {“Lim”,“Tan”}
Output variable type is String
What should the flow and syntax?
Use a For each activity and pass FirstName as input variable and change the type argument as String
Inside the loop use a ADD TO COLLECTION or APPEND ITEM TO COLLECTION activity where in collection mention the output variable name and item property mention as item.ToString+”,”+LastName(Array.IndexOf(FirstName, item.ToString)).ToString+Environment.NewLine
This will combine those two names with NewLine before to the next full name
Make sure the output variable mentioned in the activity is of type like this
System.Collections.Generic.List
You can browse this type in browse type in variable panel
You can convert this anytime to array by just mentioning like this assign activity
If you would like to print inside the for each activity itself with a writeline then skip ADD TO COLLECTION activity and just mention like this in a assign activity
Where str_output is a string variable defined in variable panel with default value as string.Empty
Then use a writeline activity next to this assign and mention as str_output.ToString
This can be mentioned even outside the for each loop and u get the same output with each full name one below the another
But for that the assign activity inside the for each loop should be like this