Skip to main content

From given list of strings (separated by new lines), extract only the 9-digit numbers that start with 1.

Input:

012345678

123456789

234567890

1234567890

Expected Output: 123456789

Please provide detailed step actions and variable to be used in each of the actions so that flow should run efficiently. 

Steps:

  1. Take all your input values in a List variable.
  2. Loop over them and check which item starts with 1 using Substring action
  3. Now you have narrowed down the items that you need to further check. All items (input) not starting with “1” are ignored.
  4. Next you can check the length of the items that starts with 1, if the length = 9 digits.
  5. Once, you get the matching items put them in another list (in case we get more than 1 items)
  6. Loop over the output list and display the output.

✅ Mark this as best answer in case this helps you.


I can also create a detailed video on explaining this, if needed.

NOTE:

In terms of execution time, it takes ~2 seconds post the bot execution window is launched. Launching bot execution windows takes somewhere around ~5 seconds.

 

Also, I have not considered any edge cases here in terms of validating input texts, error handling, logging etc. Just have quickly build this to solve the given problem statement. 

 

Bot Steps