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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Condition Evaluation not working properly?

(0) ShareShare
ReportReport
Posted on by 11

I have a flow which reads from a spreadsheet, iterates the items, considers information about the date, and then based on different conditions, it creates items on a sharepoint list.

 

For some reason, the conditional logic doesn't seem to be triggering despite the conditions being met. Would appreciate any advice!

 

The more specific items which happen are:

1) Information about today is stored in variables (essentially is today mon/tues/wed, what is the ## value for the month, what is the ## value for the day)

2) The spreadsheet contains a 'frequency' column which states if rows (tasks) are monthly, weekly, quarterly, annually, etc.

3) A variety of conditions are checked. If the row has a frequency of 'weekly' and the day is monday, create the sharepoint item. If the day is the 1st and the frequency is 'monthly', create the sharepoint item, etc. These conditions are not triggered as they should.

 

Here's the first part of the flow which establishes some information about the time via variables and then reads the spreadsheet:

agiajpeiojpdkea_0-1689704754216.png

This part seems to work fine and information is set.

 

Next, there are set of conditions which check the 'frequency' column in the spreadsheet and then based on that value (weekly, monthly, quarterly, etc.) it checks the 'date' variables to determine if it needs to create a SharePoint list item.

 

agiajpeiojpdkea_1-1689705401261.png

 

Here are what those conditions look like in detail:

agiajpeiojpdkea_2-1689705641274.png

 

For whatever reason, only the 'weekly' condition ever works properly?

agiajpeiojpdkea_3-1689705732611.png

 

All others seem to always evaluate false for some reason 😞

Here's an example for the second one where we can see the date variables match & the 2nd item on the sheet is 'monthly' but it doesn't run?

agiajpeiojpdkea_4-1689705892610.png

Here's the first few rows of the sheet:

agiajpeiojpdkea_5-1689705961272.png

 

I'm totally at a loss of how to troubleshoot further? Any ideas? 🙏

 

NOTE: I set the 'triggering' date to the 18th as that is the UTC time at the time of testing, things where it says' the first' and all of that will be adjusted once the evaluations are actually known to work properly.

 

 

I have the same question (0)
  • David_MA Profile Picture
    12,515 Super User 2025 Season 2 on at
    Re: Condition Evaluation not working properly?

    The first thing I would do is look at the run of your flow and check what values are being populated in your variables. Are they returning data in the format you have in your conditions? If so, and the output would meet at least one of your conditions, I would remove the condition check on the Excel data. Run the flow and see if it just meets the conditions using your variables. If it works, then you at least know the issue is the conditions from the Excel data.

  • agiajpeiojpdkea Profile Picture
    11 on at
    Re: Condition Evaluation not working properly?

    Trying this now.

  • Verified answer
    wskinnermctc Profile Picture
    6,519 Moderator on at
    Re: Condition Evaluation not working properly?

    Thank you for the pictures, it is very helpful. Especially showing the second item that didn't work since that gives perspective.

     

    First thing I would try would be to wrap the Excel Frequency in a trim() and string() expression something like string(trim({Frequency})) to make sure there aren't any funny line breaks or something from Excel making the data not match.

    I would also wrap the other side of the condition in a string expression, so string('Monthly') and string('Annual') so that these items are being compared equally.

    The same goes for any of these days or months that you are comparing, I would wrap them in the string() expression, or even int() integer expression, but just make sure they both match whichever you use.

     

    Another thing to do that would be great in this flow is a Switch control. Put the Switch with the Excel frequency and then add a Case for Weekly, Case for Monthly, Case for Annual etc. Then in each Case you can add a condition that checks the days/months.

    The Switch control is great with text outputs. And it would show if your problem is with the text part of the condition or the day part of the condition. Because if the Switch goes to the correct Case based on the frequency, then you know that part is correct, you just have to fix the condition that is within the Case.

     

    Hope this helps, let me know what you come up with. 

  • agiajpeiojpdkea Profile Picture
    11 on at
    Re: Condition Evaluation not working properly?

    Wrapping the #s in a string function did it. I really wish typing were clearer in this. It would also be good in the flow diagnostics to be able to see what things actually are at the time of an if condition and/or see the individual evaluations to at least know which condition is failing.

    Thank you for your help!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 659 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 386 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard