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 / "InvalidTemplate" erro...
Power Automate
Unanswered

"InvalidTemplate" error on "LessOrEqual" Condition

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

A stage of one of my flows is a "LessOrEqual" Condition which compares the value in a field on a D365 record with a fixed value (.30). The flow runs properly, but fails at the Condition, with the following feedback:

 

  • Code
    InvalidTemplate
  • Message
    Unable to process template language expressions for action 'Condition' at line '1' and column '1976': 'The template language function 'lessOrEquals' expects two parameter of matching types. The function was invoked with values of type 'Float' and 'String' that do not match.'.

 I have tried using both decimal and floating point fields as the source field on CRM, but the same error occurs.

 

Has anyone else seen/experienced this? Is it possible that the LessOrEqual Condition doesn't accept using decimals? Thank you for your time.

 

Kind Regards,

Matthew

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi MGibson,

     

    The error message shows that the data type of the two values used by "LessOrEqual" do not match.

    Coud you please share more information regarding those two values? 

    If sharing a screenshot is convenient, then I could do some tests from my side and offer a more suitable suggestion.

    We could use some function to convert the data type, for example:

    If we would like to convert "10.23" from string to float, we could input the following:

     

    "@float("10.23")"

     

    For more function reference, please check:

    Workflow Definition Language

    Hope the information above is helpful.

    Regards

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your reply - the following values have been compared to ".3" and failed: 0, 0.01, 0.08, 0.24, 1.00

     

    Could I combine the float conversion definiton and the current definition in the advanced editor? So:

     

    @lessOrEquals(body('Update_a_record')?['new_sentimentdecimal'], '.3')

     

    and

     

    "@float("10.23")"

     

    Would this work, for example?

     

    "@lessOrEquals(body('Update_a_record')?"float(['new_sentimentdecimal'])", '.3')

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi MGibson,

     

    What is your current situation?

     

    Well this is hard for me to say whether it would work, as I don't know the actual data type of your data input.

    Would you please share a screeshot here, better with description of the input values under the lessOrEquals condition?

    Regards

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have done some more testing, and I believe the source data is not the cause of the issue (these being either decimal or floating point number fields from Dynamics 365).

     

    If I set the condition in Flow as "If (source data) is less than 1", the flow will actually run as expected. This problem only occurs if a value between 0 and 1 is used to compare the source data to. For example:

     

    This flow will run:

     

    Screenshot (90).pngScreenshot (91).png

    This one will not:

    Screenshot (93).pngScreenshot (92).png

    I hope this clarifies the issue. Thank you again for your support on this.

     

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Thanks for the detailed update.

    I just tested the ".5" value with SharePoint source, and it works.

    30.PNG31.PNG

     

     In addition, try to change he formula under advanced editor with the format below:

     

    @lessOrEquals(float( body('Update_a_record')?['new_sentimentdecimal'] ), '.3')

     

    Regards

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard