You build a flow, pull some data from a SharePoint list or Excel file, and everything looks fine… until you try to add two numbers and your result is 1020 instead of 30. The value is coming in as a string (text), not a number, and suddenly your calculations, conditions, and approvals start behaving in strange ways.
I’ve seen this in HR leave flows, sales commission flows, and even basic notification flows. A column that “should be numeric” is actually stored as text, or comes from a form, API, or email where everything is treated as a string. If you don’t convert that string to a float (decimal number) at the right point, your cloud flow will give you wrong results or sometimes fail.
In this guide, I’ll walk you through exactly how to convert string to float in Power Automate, step-by-step, using real examples and expressions you can copy, plus a few battle-tested tips that will save you hours of debugging.
Why Convert String to Float in Power Automate?
Before we jump into expressions, it helps to understand why this matters so much in real flows.
Many triggers and actions in Power Automate treat incoming data as text, even if the field “looks” like a number. For example:
- A Microsoft Forms response for “Total Hours Worked” is text.
- A SharePoint column defined as “Single line of text” stores numeric values as strings.
- An API returning JSON might send
"amount": "1200.50"instead of a true number.
If you try to perform numeric operations directly on those text values, you will get:
- Incorrect concatenation (
"10" + "20"becomes"1020"). - Condition checks that never match (
greaterOrEquals('10','2')does a string comparison). - Format issues when you try to use formatNumber or float-based calculations.
You can see similar patterns when working with numeric conversions like convert float to integer in Power Automate, where getting the type right is key for downstream actions.
In practice, converting string to float is the foundation for any scenario where you calculate totals, tax, leave balances, or percentages in your flows.
Example Scenario: HR Leave Request Flow
Imagine an HR team using a SharePoint list called Leave Requests for a 200-employee company. The key columns are:
- Employee Name – Single line of text
- Leave Type – Choice (e.g., Annual, Sick, Casual)
- Requested Days – Single line of text (this is where the problem starts)
- Manager Email – Single line of text
- Status – Choice (Pending, Approved, Rejected)
An automated cloud flow using the trigger When an item is created runs for every new leave request. The flow:
- Reads the Requested Days field.
- Calculates remaining leave balance.
- Sends an email to the manager with details.
- Logs the result in another list or sends a Teams message.

Because Requested Days is stored as a string, we must convert it to a float before doing any math or comparisons.
While building this, it’s also common to add related capabilities such as counting rows in a SharePoint list using Power Automate or looping through list items to calculate summary values.
Understanding String and Float in Power Automate
In Power Automate, every piece of data has a type:
- String – text, such as “10”, “123.45”, “ABC123”.
- Float – decimal number, such as 10, 123.45, 0.75.
- Integer – whole number, such as 10, 1000.
- Boolean – true or false.
You can check and work with these types using various functions. For example, there is a dedicated isFloat function, which is explained in detail in this Power Automate isfloat guide.
To convert string to float, we usually use:
- float() function – convert string to float.
- coalesce() – fall back to a default value when something is null or empty.
- trim() – clean up whitespace around values.
The key is to apply these functions in the right place in your flow so everything downstream works with proper numeric types.
Convert String to Float in Power Automate
Now I will tell you different methods you can choose based on your requirements.
Method 1: Convert String to Float with the float() Function in Power Automate
The most direct way to convert a string to a float in Power Automate is the float() function. It takes a string as input and returns a floating-point number.
When to Use a Float Variable
Use float() when:
- You’re reading numeric values stored as Single line of text in SharePoint or Dataverse.
- You’re receiving numbers from forms, emails, or APIs as strings.
- You need decimal precision for calculations (for example, days in decimals, currency, or percentages).
If you already handle other conversions (like formatting numbers or converting string to date), using float() will feel very natural.
Step-by-Step: Using float() in an Expression
Let’s go back to our HR Leave Request scenario.
- Trigger: Create an automated cloud flow with the trigger When an item is created (SharePoint connector).
- Get the Requested Days: Power Automate will give you a dynamic value like Requested Days from the trigger. This value is text.
- Add a Compose action: Insert a Compose action (under Data operations) to test the conversion.
- Use the float() expression: In the Inputs box of the Compose action, switch to the Expression tab and use:
float(triggerOutputs()?['body/RequestedDays'])
Here, RequestedDays is the internal name of the column.
This expression converts the string stored in Requested Days to a float. You can then use the output of this Compose action in later calculations or conditions.
If you frequently manipulate text fields, you may also benefit from guides like remove characters from a string in Power Automate or split a string between two characters to clean the data before conversion.
Pro Tip: I’ve found that it’s safer to convert strings to float in a dedicated Compose or Initialize variable action early in the flow. That way, every downstream action references the converted value, and you avoid sprinkling complex expressions everywhere.
Method 2: Convert String to Float with Variables in Power Automate
Sometimes you need to use the converted number in many different places, or inside loops like Apply to each. In that case, I prefer to use a float variable instead of only a single Compose action.
When to Use a Float Variable
Use a float variable when:
- The numeric value is used across multiple actions.
- You’re working inside Apply to each loops.
- You may need to update the value as you calculate running totals or perform multiple operations.
This approach also pairs nicely with other scenarios where you manage data using variables, like creating arrays from JSON objects or converting arrays to strings.
Step-by-Step: Using a Float Variable
Again, using our HR Leave Request example:
- Add an Initialize variable action near the top of your flow.
- Name: varRequestedDays
- Type: Float
- Value: keep it blank for now.
(If you’re new to object or other variable types, you might also find initialize object variable in Power Automate helpful for related patterns.)
- Set Variable with Converted Value
- Add a Set variable action right after the trigger.
- Choose varRequestedDays as the variable.
- In the Value field, go to the Expression tab and enter: float(triggerOutputs()?[‘body/RequestedDays’])
- Click OK to insert the expression.
- Now you can use varRequestedDays anywhere you need to:
- In a Compose action for calculations.
- In a Condition action to check if the requested days exceed a threshold.
- In any arithmetic expression combined with other numeric values.

Example condition:
greaterOrEquals(variables('varRequestedDays'), 5)This checks if the requested days are greater than or equal to 5. You can then route the flow accordingly, for example, adding extra approval steps or notifications.
Pro Tip: In my experience, using well-named variables like
varRequestedDaysorvarTotalHoursmakes debugging much easier. When a flow fails, you can clearly see which converted values were used, especially in more complex flows with nested loops and conditions.
Method 3: Handle Invalid or Empty Strings Before Conversion
Real-life data is messy. Sometimes the field is empty, contains spaces, or has invalid characters like commas or letters mixed in (“10,5”, “N/A”, “–“). If you try to apply float() directly on such values, your flow can fail with template language errors.
This is where data cleaning comes in. You’ve probably seen similar techniques when working with substring operations or trim functions in Power Automate.
Checking if a String Is a Float in Power Automate
Use the isFloat() function to safely check if the string value can be converted:
isFloat(triggerOutputs()?['body/RequestedDays'])
This returns true if the value is a valid float, otherwise false.
You can wrap this inside a Condition action:
- Left value (use expression):
isFloat(triggerOutputs()?[‘body/RequestedDays’]) - Operator: is equal to
- Right value:
true
In the If yes branch, you convert the string to float and proceed. In the If no branch, you can:
- Set a default value (like
0). - Send an error notification.
- Stop the flow using the techniques discussed in how to stop a flow in Power Automate.

Cleaning the String Before Conversion in Power Automate
If your string contains extra spaces or formatting characters, clean it first:
- Use trim() to remove spaces
trim(triggerOutputs()?['body/RequestedDays'])
- Remove commas or other characters. We can use replace()
float(replace(trim(triggerOutputs()?['body/RequestedDays']), ',', ''))
This is helpful when numbers come in as "1,234.50" and your environment expects dot as the decimal separator.
- Combine isFloat() and float(). Use a Condition or even nested expressions to safely convert:
if( isFloat(replace(trim(triggerOutputs()?['body/RequestedDays']), ',', '')), float(replace(trim(triggerOutputs()?['body/RequestedDays']), ',', '')), 0 )
This way, you either get a valid float or a safe default value (0 in this example).
Pro Tip: When I build production-ready flows, I almost always include defensive checks like isFloat(). These checks combined with error handling patterns in Power Automate reduce random failures caused by unexpected data.
Real Example: Calculate Remaining Leave Balance
Once you’ve converted your string to a float, you can start using it in actual business logic.
Let’s say you maintain another SharePoint list called Employee Leave Balances. Each row has:
- Employee Email
- Total Leaves Per Year (number)
- Leaves Taken (number)
- Remaining Leaves (number)
In your HR leave flow:
- Use Get items on the Employee Leave Balances list to find the current user’s record.
(If you’re working with OData filters, this pairs well with patterns like Get items filter query multiple conditions.) - Convert Requested Days to float (as we covered).
- Add a Compose step to calculate new remaining leave:
sub(items('Apply_to_each')?['RemainingLeaves'], variables('varRequestedDays'))Here, we assume this runs inside an Apply to each loop over the Get items results.
- Update the Employee Leave Balances list item with the new remaining value.

If you’re doing more advanced math or date-based calculations, check out resources like calculate date difference in Power BI or Power Automate dayOfWeek function for related concepts.
Pro Tip: I like to keep all my numeric calculations in Compose actions and only one final Update item action. This makes it easy to adjust formulas later, without touching the rest of the logic.
Avoiding Common Conversion Errors
When you work with string-to-float conversions, there are a few typical errors that pop up.
Unable to process template language expressions
This error usually occurs when:
- You are passing an empty or null value into float().
- The string contains non-numeric characters.
- You reference the wrong property name in
triggerOutputs()oritems().
If you see this error, double-check:
- Column internal names (for example,
Requested_x0020_Days). - Input values via Peek code for the action.
- Whether the value is truly a number as string.
If you hit similar parsing issues, you may also want to review patterns from unable to process template language expressions in action and parsing select and expand failed.
Locale and Decimal Separators
In some environments, numbers use commas instead of dots for decimal separators. For example:
- “10,5” instead of “10.5”.
In such cases:
- Use replace() to standardize the format before conversion.
- Confirm how your data source formats numbers.
Example:
float(replace(triggerOutputs()?['body/RequestedDays'], ',', '.'))
Handling Null or Missing Values
Never assume that the numeric field will always be populated. Instead:
- Use coalesce() to supply a fallback:
float(coalesce(triggerOutputs()?['body/RequestedDays'], '0'))- Combine with isFloat() in conditions as described earlier.
Pro Tip: For critical flows, I like to log the raw string value before conversion (for example, in a Compose or Append to string variable). When someone raises a support ticket, those logs make it much easier to diagnose why the conversion failed.
Things to Keep in Mind
- Always know your data source type: Check if the column is Single line of text, Number, or a calculated value in your SharePoint list before deciding where to convert.
- Use isFloat for defensive checks: Validating with isFloat() prevents many runtime failures and pairs well with robust error handling flows.
- Clean your strings first: Use trim(), replace(), and other string functions if your input contains spaces, commas, or extra symbols before applying float().
- Centralize conversions: Convert string to float once (via Compose or variable) and reuse that value instead of repeating the expression everywhere.
- Watch for locale differences: Be careful with decimal separators in international setups; standardize your format before conversion.
- Test with multiple cases: Run your flow with typical, maximum, and invalid values to verify that conversions behave as expected and error paths are handled.
Frequently Asked Questions
How do I convert string to float in Power Automate?
You convert a string to a float in Power Automate using the float() function in an expression. For example, float(triggerOutputs()?[‘body/RequestedDays’]) converts the Requested Days text field to a float so you can use it in calculations or conditions. You can place this expression inside a Compose action, a Set variable action, or directly inside a Condition.
How can I check if a string is a valid float before converting?
Use the isFloat() function to test whether a string can be converted to a float. For example, isFloat(triggerOutputs()?[‘body/RequestedDays’]) returns true when the string is numeric and false otherwise. Combine this with a Condition action so your flow only calls float() when the value is safe to convert, and handle the invalid case in a separate branch.
What should I do if float() throws an error?
If float() throws an error, the input is likely null, empty, or has invalid characters. Start by trimming and cleaning the string using trim() and replace(), and then wrap the conversion inside isFloat() checks or use coalesce() to provide defaults. If the error persists, inspect the raw input in the run history and apply patterns from error-focused articles like unable to process template language expressions in action.
How do I convert a float to an integer after converting from string?
Once you’ve converted your string to float with float(), you can convert it to integer using int(). For example, int(float(triggerOutputs()?[‘body/RequestedDays’])) first converts the string to float and then to integer. If your goal is specifically to work with integers in your flow, consider following patterns similar to convert float to integer in Power Automate.
Can I use float conversion inside an Apply to each loop?
Yes, you can safely convert strings to float inside an Apply to each loop. Use a Compose action or a Set variable action inside the loop and reference the current item with items(‘Apply_to_each’)?[‘ColumnName’]. This is especially useful when you are looping through SharePoint list items to calculate totals, balances, or aggregated metrics.
How do I handle string to float conversion in complex flows with multiple triggers?
In more complex solutions, start by centralizing your conversions at the top of your flow right after the trigger fires. Initialize float variables and assign values using float(), isFloat(), and coalesce(), then reuse those variables for all calculations. This approach aligns well with broader best practices like trigger conditions in Power Automate and structured error handling.
You’ve seen how to convert string to float in Power Automate, clean messy data, and safely use numeric values in real-world HR-style flows. If you build your conversions early and defensively, your flows will be more robust and easier to maintain. I hope you found this article helpful.
You may also like:
- Convert string to date using Power Automate
- Get User Email Address in Power Automate
- Power Automate formatNumber function explained
- Power Automate isFloat function with examples
- Power Automate remove characters from a string

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.