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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow fails sometimes |...
Power Automate
Unanswered

Flow fails sometimes | The template language function 'int' was invoked with a parameter that is not valid.

(0) ShareShare
ReportReport
Posted on by 8

I have a flow that registers leave days.

* one sharepoint list keeps the leave days on the employee record

* one sharepoint list I create a transaction record

-> the flow takes the transaction record and updates the leave column on the employee record.

 

That mostly works. But then for some reason, every now and again it doesn't.

Whilst everything is exactly the same! (at least as far as I can see).

Mysterious.

 

here is a screenshot

 

Martinus_0-1664358875549.png

 

The Compose action calculates the new leave.

the condition Sick Leave checks if leave does not go under zero

 

The return from the compose is always in the same format.

And sometimes the Condition Sick leave gives this error:

"Unable to process template language expressions for action 'Condition_Sick_Leave' 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.'."

 

below a screenshot

Martinus_1-1664359055398.png

 

As you can see the compose action returns a number. Which is correct.

Then the condition decides it cannot work with this number.

 

this is the condition code:    int(outputs('Compose_SickLeave'))

and again: normally it works with the result from the Compose action.

 

hope someone knows that this might be. 

power automate can be complex, but it should not be mysterious.

 

thanks in advance

 

Martijn

 

Categories:
I have the same question (0)
  • Verified answer
    Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @Martinus ,

     

    Use this expression to convert Float to Integer:

    int(first(split(string(outputs('Compose_SickLeave')),'.')))

    Update the output as per Compose name

     

    Let me know if any queries.

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.


    Regards
    Kaif

  • Martinus Profile Picture
    8 on at

    Dear Kaif,

     

    Thanks a lot for this very speedy reply

     

    I entered your suggested expression and it worked!

    It is still a mystery to me though. 🙂

    Can you perhaps explain what this expression does? and why it is required to make my flow work?

     

    I'll wait for your reply on this before I post it as solved, because I don't know whether that would auto close this topic.

     

    best,

    Martijn

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @Martinus ,

     

    Lets break the expression into sub expressions:

    int(first(split(string(outputs('Compose_SickLeave')),'.')))

     

    • Convert the outputs to string:
      • string(outputs('Compose_SickLeave'))  --> "29.5"
    • Split strings into multiple substrings based on a delimiter provided(i.e. decimal - '.').  
      • split(string(outputs('Compose_SickLeave')),'.') --> "29" and ".5"
    • first function will return the first character of the array
      • first(split(string(outputs('Compose_SickLeave')),'.')) --> "29"
    • int will convert value to integer
      • int(first(split(string(outputs('Compose_SickLeave')),'.'))) --> 29 (integer value)

     

    Hope this will help you.

     

    Regards

    Kaif

  • Martinus Profile Picture
    8 on at

    thanks Kaif,

     

    this does make things clear. And I also understand how deconstructing it and then putting it together again makes a bullet proof integer.

     

    What remains is that the flow did not accept the original 29.5 for this run, but other runs that included decimal integers were successful. So at that level, the mystery is not solved.. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard