Power Automate if String is integer

Loading

Requirement: To check whether a string is an integer or not in Power automate flow

Click on +create from home page, click on Instant flow Provide name to the flow select manually trigger a flow and click on create button.

Select and add 2 initialize variable as action provide name, type and value as shown in below:

Next, to convert the string value to an integer, click on the next step and select a compose action. Then provide the below expression:

int(variables('varnum'))

Now set the variable ‘isInteger’ to false, so click on the next step and select Set variable action. then select the variable name and set the value as false.

And also set the configure run after and set it to has failed. So click on the more icon and select Configure run after. And then select has failed.

Next, check if the condition isInteger is true or false, so click on the next step and select Condition action. Then provide

  • Value : IsInteger from dynamic content.
  • operator: is equal to
  • value : true

Next, set the configure run after properties ‘is successful’, so click on the more icon and select configure run after. Then select is successful and is skipped.

Now Save and Run the flow to check it is integer or not and for non numeric.

Flow for numeric
Flow for non-numeric

Leave a Reply

Your email address will not be published. Required fields are marked *