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 / float will not convert...
Power Automate
Answered

float will not convert to int

(0) ShareShare
ReportReport
Posted on by 422

I have never experienced this issue before.  I have a SharePoint Number Column.  In my flow I want this number to be an integer, so I simply take it and put inside the expression int().  Till now this has worked but now in a new flow I get the logic error:

 

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

 

The number I am testing is 

1.42857142857143
 
The column in SP is set to number with no decimals, but as always it still returns decimals in flow if it is not whole.
 
I must be missing some logic.  The error above is a compose,  but it also fails in a another variable of type integer.  It does return in a float variable OK,  but I must have an integer
 
Categories:
I have the same question (0)
  • Ventit Profile Picture
    422 on at

    In order to resolve this I had to:

    1. Initialize a string variable that capture the column as a float
    2. Using a compose I then converted to an int by using a substring to remove after the decimal point 

    I see this as a significant work around for something that was very simple in past so not sure what is actually different

  • Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi @Ventit 

     

    To extract only the integer and ignore the decimal part, pls use the below expression:

    int(first(split('1.42857142857143','.')))

    pls pass the variable in place of float number in the above expression.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Ventit Profile Picture
    422 on at

    Does it give an error if there is no decimal point

  • Verified answer
    Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi @Ventit 

     

    No, it wouldn't give an error if decimal point is not present in the input sting.

     

    If my reply helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • FA-22072253-0 Profile Picture
    3 on at

    It worked!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard