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 / Condition not working ...
Power Automate
Answered

Condition not working correctly with LIST ROWS PRESENT IN A TABLE?

(0) ShareShare
ReportReport
Posted on by

Hi

I am trying to run a condition, but it keeps returning the wrong answer. 

 

I am listing rows present in an Excel table, and then in an APPLY TO EACH, applying a CONDITION:

 

1. Current Quarter IS GREATER THAN int('0') &&

2. Previous Quarter IS GREATER THAN int('0') &&

3. Previous Quarter 2 IS EQUAL TO "" "" (i.e. blank).

 

Even when I deliberately set the values in the row to be greater than 0, it still returns FALSE? I am having to use "int('0')" otherwise the gives me an error saying the two are incompatible?

 

Many thanks. 

Categories:
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @jed76 

     

    Pls try converting the values of columns 'Current Quarter' and 'Previous Quarter' coming from excel to integer using expression.

     

    Here is the example, ID column contains some numeric values:

    Input excel table:

    ManishSolanki_1-1690811906724.png

     

    ManishSolanki_0-1690811729787.png

     

    Expression used for left side operand:

    int(item()?['ID'])

     

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

     

    Thanks

  • jed76 Profile Picture
    on at

    Seemed to work until I had decimal numbers in the source? When I had a whole number it seemed to work but now I am getting the error The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @jed76 

     

    To trim off the decimal number to integer, you can use the following expression for the left-hand side operand:

    int(formatNumber(float(item()?['ID']),'#'))

    ManishSolanki_0-1690821596296.png

    Pls note that it would round off the decimal number but will trim off the decimal part and will return only the numeric part.

     

     

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

     

    Thanks

  • jed76 Profile Picture
    on at

    Many thanks but I need the full decimal numbers? 

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

    Hi @jed76 

     

    In that case, just wrap the value using float() function which parses the decimal number. Below expression is used for handling whole number & decimal numbers:

    ManishSolanki_1-1690877188061.png

    Expression used for left hand operand:

    float(item()?['ID'])

     

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

     

    Thanks

  • jed76 Profile Picture
    on at

    Thank you very much - that seems to be doing the trick!!

  • gng Profile Picture
    167 on at

    Jumping on this conversation, what if you want to filter a decimal column through Odata? When I try to filter by decimal, no records are returned. I have no problem for string fields and date fields.

     

    Removing the filter returns all the records.

     

    gospa_0-1700333850347.png

     

     

    I've tried:

     

    mserp_settleamountcur eq 0

    mserp_settleamountcur eq '0'

    mserp_settleamountcur eq 0.0

    mserp_settleamountcur eq 0.0M

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @gospa 

     

    Based on the data in screenshot, the query should use 'greater than' operator instead of 'equals to':

    mserp_settleamountcur ge 0

     Pls try the above query & retest the flow.

     

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

     

    Thanks

  • gng Profile Picture
    167 on at

    Thanks for the reply. Upon further testing it seems that the field in question is the issue, not the filter. I tried it on other decimal fields and it worked fine. I believe the reason it doesn't work for certain ones is because of something else unrelated. This is a virtual table that came from dynamics 365 finance and operations data entity. Some of these fields aren't populated until the post load step of the data entity.

     

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
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard