This Power Automate tutorial will show us how to convert float to integer in Power Automate with different examples.
I will show two examples of converting float to int using Power Automate.
In the first example, the flow will trigger manually, asking to enter a value in a textbox. If the user enters a float value like 16.233, it will use the int function and return an integer value of 16.
In the second example, we will see the dynamic approach, where the flow uses a manual trigger and gets all items from the SharePoint list. The Product Price column, which has a float value like 1495.23, converts to an integer value using the int function, returns the value as 1495, and updates the SharePoint list.
Convert float to integer in Power Automate
To achieve this, follow the below steps:
We will discuss converting a float to an integer value using Power Automate or Microsoft Flow.
Example-1: (Manual Approach)
- Initially, log in to Power Automate flow using the credentials, and select +Create -> instant cloud flow.
- Enter the flow name, Choose Manually trigger a flow, and click on the create option as highlighted below:
Expand the Manually trigger action, and add a Number input to enter the number value in a float data type.
Add a compose data operation, and pass the below expression to convert the float type value to an integer data type.
Save and Run the flow by selecting the run flow option. Enter the Float number value Here, I gave the input value as 16.233 and click the run flow option.
Once our flow ran successfully like below, we can see it will use the int function, convert the float value to an integer value, and return the value as 16 in the output of the compose data operation.
This is how to convert a float to an integer value using Power Automate Flow.
Example-2: (Dynamic Approach)
In this example, we are going to use the below SharePoint list called Products consisting of,
- ProductName – default Title column
- ProductQuantity – Number column
- ProductPrice – Number column (Float Values)
- Login to Power Automate and create an instant cloud flow. Select + new step and choose the Get items action from the action triggers.
- Configure the SharePoint site address and List Name. Here my List Name is Products.
Add an apply to each control and pass the dynamic content values to loop through all the items presented in the SharePoint list.
Add +new step and choose the select data operation in the from section, pass the dynamic content values, and in the map field, pass the ProductPrice value.
Add a compose data operation, and pass the below expression to convert the float type value to an integer data type for the ProductPrice column.
Select the +New step and add the Updated item action from action triggers and provide the below-required fields:
- Site Address – Choose the SharePoint site address
- List Name – Select the List Name
- ID – Select ID from the dynamic content value.
- Title – Pass Title value from dynamic content.
- ProductPrice – Choose the Output of the compose action from the dynamic content value to update as an integer value.
Save and Run the flow by selecting the run flow option. It retrieves all the items from the SharePoint list, loops through the values, and converts the float to int using the int function. Once our flow ran successfully like below:
The ProductPrice column has been updated to the integer data type value from the float type value.
This is how to dynamically convert a float to an integer value using Power Automate Flow.
In this Power Automate tutorial, we saw how to convert float to integer in Power Automate with different examples.
You may also like:
- How to convert string to Date using Power Automate?
- Convert HTML to Text using Power Automate
- Convert XML to CSV using Power Automate
- How to Convert CSV to Excel using Power Automate?
- How to Check if an item exists in a SharePoint list using Power Automate?
After working for more than 15 years in Microsoft technologies like SharePoint, Office 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 (9 times). I have also worked in companies like HP, TCS, KPIT, etc.