Splitting a string of values by comma and entering each value obtained

Hi Team, I am building an automation, where I have to Split values present in the country Column by “,” and then type each value thus obtained into a Text Box within an app one by one and then click on enter. The issue is if I enter the entire string for eg- India,United States,France in one go, the text box won’t identify it.

Sharing an example below -

Country
India,United States,France

Aim (step-wise)

  1. Type India in the text box.
  2. Type United States in the text box.
  3. Type France in the text box.
  4. Click on Enter in the end

*Note - There could be ‘n’ of countries in a list, in the above example its only three.

@Raghav_Dhawan

Welcome to the community

Str.Split({","},StringSplitOptions.RemoveEmptyEntries)

This will split the string on comma and give you an array of strings woth eqch country…

Now use a for loop with inargument as above given split or the array variable where the above split is stored and chamge type argument to string in for loop properties

Now inside the loop currentitem will give you each string for each iteration… use your type into activity inside the loop with currentitem as the value

And after the loop you can click on enter

Cheers

1 Like

Hi @Raghav_Dhawan, Welcome to the Community.

Assuming that you want to enter the country names one after the other in the same text box & then enter in the end, you can replace the , with a blank space which will give you a string with the desired format. You can type into the text box in one shot & proceed.

yourString.Replace(","," ")

Hope this helps,
Best Regards.

1 Like

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