Do you know how to check if a given input is an integer in Power Automate? Imagine you are working in a flow where a user inputs or SharePoint list values, and you need to validate whether a string contains a whole number before proceeding to the next steps. If the value is not a valid integer, your flow may give an error or incorrect results.
In this Power Automate tutorial, I will show you how to check if an input string is an Integer Using Power Automate.
Check If an Input String Is an Integer Using Power Automate
Suppose you are creating an automated flow for a customer feedback system. Users submit feedback via a Microsoft Form, which includes a field requiring them to enter their Customer ID, which should be an integer (12345). However, some users might accidentally enter non-numeric values (12a34 or abc).

Now, in the Power Automate flow, you need to validate whether the Customer ID is an integer. If it is, the flow needs to be added into a SharePoint list; if not, it sends an email notification to the user asking them to correct their input.
To do this, follow the below steps:
1. Go to Power Automate and create a new flow. Choose the trigger: When a new response is submitted (Microsoft Forms connector). Select your form (Customer Feedback System) from the dropdown.

2. Add the Get response details action (Microsoft Forms connector). Select the Form ID from the dropdown (dynamic content from the trigger). Map the Response ID to the trigger’s Response Id dynamic content.

3. Add the Initialize variable action and provide the below parameters:
- Name: IsInteger
- Type: Boolean
- Value: true

4. Add the Compose action and provide the expression as below:
int(outputs('Get_response_details')?['CustomerID'])
where “CustomerID” is the field name from your form (replace it with the actual field name from your form’s dynamic content).

5. Add a Set variable action and provide the below required parameters:
- Name: IsInteger
- Value: false

6. Then click the Set variable action -> click one Settings tab -> Set this action to run only if the Compose action has failed. Like the screenshot below:

7. Add the Condition action and add the below:
@{variables('IsInteger')} is equal to true.

8. Then click the Condition action -> click one Settings tab -> click the + Select actions -> add the compose action:

9. In the Ture section, add a Create item action (SharePoint connector) and provide the below required parameters:
- Site Address: Select your SharePoint site.
- List Name: Select your list.
- Customer ID: Use the Customer ID from the form’s dynamic content.
- Customer Name: Use the Customer Name from the form’s dynamic content.
- Email: Use the Customer Email from the form’s dynamic content.
- Feedback Comments: Use the Detailed Feedback from the form’s dynamic content.

10. In the False section, add a Send an email (V2) action (Outlook connector) and provide the below required parameters:
- To: Use the email field from the form (dynamic content).
- Subject: “Invalid Customer ID”
- Body: “The Customer ID you entered (‘[Customer ID]’) is not a valid integer. Please submit a numeric value.”

Save the flow, then submit test responses via the form:
- Test 1: Enter “12345” (should log to SharePoint).

- Test 2: Enter “12a34” (should send an email).

Conclusion
In this tutorial, we learned how to validate if an input string is a whole number (integer) in Power Automate. Using a Microsoft Form as the trigger, we collected a Customer ID and checked whether it was a valid integer using a Compose action with the int() expression.
If the conversion failed, we used a Boolean variable and configured the flow to detect the failure. Based on the result, we either added the data to a SharePoint list or sent an email asking the user to correct the input.
Moreover, you may like some more Power Apps tutorials:
- Check If an Array Contains Value in Power Automate
- Delete Files From SharePoint Document Library Using Rest API in Power Automate
- Check If an Array is Empty in Power Automate
- Check If the Body is Empty in Power Automate
- Rename SharePoint List Using Power Automate
- Check If the Column is Changed in Power Automate

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.