web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert String Decimal...
Power Automate
Answered

Convert String Decimal to Int/Float?

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

How can I convert a Decimal String value to an Integer/Float?

 

For example... I have a string called 'StringDuration' that is 0.27. How can I convert this string to a Float?

 

I have tried...

@{float(variables('StringDuration'))}

  

but it gives the error "The variable 'StringDuration' of type 'Integer' cannot be initialized or updated with value '0.27' of type 'Float'. The variable 'StringDuration' only supports values of types 'Integer'."

 

If I try...

 

@{int(variables('StringDuration'))}

 

It gives the error "Unable to process template language expressions in action 'StringDuration' inputs at line '1' and column '2258': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'."

 

How can I convert a String Decimal to a Float?

Categories:
  • Verified answer
    Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hello @Anonymous 

     

    Where are you doing this expression?

    The expression you’re using float(variables(‘StringDuration’)) looks correct, try using it in a Compose action

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Jcook ,

     

    After putting in a Compose action, it seems to be working, but still getting the error "Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2257': 'The template language function 'float' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'." 

     

    After checking each iteration, I couldn't find where it error'ed out and noticed that it actually worked even though it threw that error. Why is this error happening? 

     

    Thanks

  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hi @Anonymous 

     

    is the compose action inside a loop?

    How are you able to tell if it is working?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The error was being thrown for a different reason. 
    Thanks for helping me solve this!

  • Manojkumar95 Profile Picture
    5 on at

    I am getting the same error. What is the solution here?

  • SamuelBenjamin Profile Picture
    70 on at

    Me the same. Could you share the solution??

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard