Last week, while working with a client, I got an interesting requirement: they needed to check if a string contained any numbers in Power Automate. At first, it seemed like a simple task, but as I explored different approaches, I found two interesting ways to achieve this.
In this tutorial, I will tell you how to check if a string contains numbers in Power Automate using a combination of expressions and actions.
Check if a String Contains Numbers in Power Automate
Now I will show you two different ways to check if a string contains numbers in Power Automate:
Check if a String Contains Numbers Using Select Action
Recently, I had a requirement to check if a string contained numbers using Power Automate. For example, if a user entered “Text123”, the flow should identify that numbers are present and return True. But if the input was just “Text”, it should return False.
1. Create a new Instant Cloud Flow and choose Manually trigger a flow as the trigger. Then, expand the trigger action and add a Text input field where users can enter the string to check.

2. Add an Initialize Variable action and add the below parameters to create a reference list of numeric values (0-9) that we will use to check against the input string:
- Name: Numbers
- Type: Array
- Value: Provide expression to create an array of numbers from 0 to 9:
createArray('0','1','2','3','4','5','6','7','8','9')
3. Add the Select action and add the below parameters:
- From: Provide the below expression to generate an array of positions in the input string:
range(0, length(triggerBody()['text']))With the help of this, we check through each character in the input string to check if any of them are numbers.
- Map: Provide the below expression to check each character against the initialized Numbers array:
if(contains(variables('Numbers'), slice(triggerBody()['text'], item(), add(item(), 1))), true, false)
4. Add a Condition action to check if the Select output contains true:

5. Then in the true section, add a Compose action that outputs The input string contains numbers and in the false section, add a Compose action that outputs The input string doesn’t contain any numbers.

Save and run the flow manually, then provide the string like EnjoySharePoint123.

After the flow runs successfully, Expected Output: True (The input string contains numbers).

Check if a String Contains Numbers Using Expression
Imagine you have a SharePoint list named Customer Requests with a column called Request Details (Single line of text):

Where users submit their requests. Sometimes, users include reference numbers or invoice IDs within the request details, and you must identify entries containing numbers.
Now to do this follow the below steps:
1. Create an Automated Cloud Flow using the SharePoint connector’s ‘When an item is created‘ trigger. Select the SharePoint site where your ‘Customer Requests‘ list is present, and choose the ‘Customer Requests‘ list.

2. Add a compose action and provide the following expression:
or(contains(triggerBody()?['RequestDetails'], '0'), contains(triggerBody()?['RequestDetails'], '1'), contains(triggerBody()?['RequestDetails'], '2'), contains(triggerBody()?['RequestDetails'], '3'), contains(triggerBody()?['RequestDetails'], '4'), contains(triggerBody()?['RequestDetails'], '5'), contains(triggerBody()?['RequestDetails'], '6'), contains(triggerBody()?['RequestDetails'], '7'), contains(triggerBody()?['RequestDetails'], '8'), contains(triggerBody()?['RequestDetails'], '9'))
3. Add a Condition action to check if the compose output is equal to true:

4. Then, in the true section, add a Compose action that outputs The input string contains numbers; in the false section, add a Compose action that outputs The input string doesn’t contain any numbers.

Save the flow, go to the SharePoint list Customer Requests, and add an item.

After the flow runs successfully, check the compose output.

Conclusion
In this tutorial, I explained two methods for checking if a string contains numbers in Power Automate. The first approach used the Select action, where we compared each character in the input string against a predefined array of numbers (0-9). The second approach relied on an Expression that checked if any numeric character was present in a SharePoint list column.
You may like:
- Convert String to Float in Power Automate
- Get File Content Using Path in Power Automate
- Convert String to GUID in Power Automate
- Convert a String to an Integer in Power Automate
- Convert a String to a Decimal Number in Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.