Recently, while working on a Power Automate Flow to generate a PDF from SharePoint list items, I encountered a challenge: some numerical values stored in my SharePoint list were in text format instead of numbers. This became a problem when I needed to perform calculations, as Power Automate treats string values differently from integers.
If you have ever faced a similar issue, don’t worry! Power Automate provides an easy way to convert a string to an integer using the int() function. In this tutorial, I will tell you how to convert a string to an integer in Power Automate.
INT Function in Power Automate
Power Automate int() function converts a number or numeric string into an integer (a whole number). It removes any decimal part and returns only the entire number.
Syntax:
int('<value>')
- Input: You can give it a number or a string ( “12”).
- Output: It will give you a proper Integer value (12).
Convert String to Integer in Power Automate
Suppose you have a SharePoint list called Sales Orders with a column named Order ID (Single line of text). Each Order ID follows the format “SO-1001”, “SO-1002”, etc.

Now, you need to extract the numeric part of the Order ID, convert it into an integer, add 10, and store that value in the Updated Order Number (number) column.
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 Sales Orders list is present, and choose the Sales Orders list.

2. Add Compose action to extract the numeric part from Order ID. To do this, use the following:
replace(triggerBody()?['OrderID'],'SO-', '')- triggerBody()?[‘OrderID’]: Gets the value from the Order ID column (e.g., “SO-1001”).
- replace(text, oldValue, newValue): Replaces “SO-” with “” (empty string).

3. Add a Compose action to convert the string to an integer:
int(outputs('Compose'))
4. Then, add a Compose action to add 10 to the order number.
add(outputs('Compose_1'),10)
5. Add an Update item action to update the Compose action value in the ‘Updated Order Number’ column and provide the following parameters:
- Site Address: Select a specific SharePoint site from drop-down.
- List Name: Choose a particular list.
- Id: Select Id from dynamic content under When an item is created.
- Updated Order Number: Provide the output from dynamic content compose 2.

Save the flow and run it manually. Then, go to the SharePoint list and add a new item.

After the flow runs successfully, refresh the SharePoint list. The value will be updated in the ‘Updated Order Number‘ column.

Conclusion
In this tutorial, we tackled the issue of converting a string to an integer in Power Automate using the int() function. We worked with a SharePoint list where the Order ID column stored values as text (“SO-1001”). We used the replace() function to extract the numeric part, then converted it to an integer using int(), added 10, and updated the Updated Order Number column.
You may like the following tutorials:
- Convert String to Float in Power Automate
- Convert a String to a Decimal Number in Power Automate
- Convert a String to an Integer in Power Automate
- Replace Commas with New Lines in Power Automate
- Extract Number From String in Power Automate

Preeti Sahu is an expert in Power Apps and has over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of Microsoft Power Platform: A Deep Dive book. As a Power Platform developer, she has worked on developing various tools using Power Apps and Power Automate. She also makes Microsoft 365 videos and shares them on YouTube.