I have a very simple query in Power Query in flow that provides a row count for a table based on certian critera. Right now I have it it as just a value (that is what Power Query in Power BI/Excel see it as) but when I pass it to a Condition in Flow, it gives the error that it is expecting an integer or decimal number, not an object.
How can I write a flow that simply evaluates a row count, and if the row count > 0 then do something, otherwise do nothing.
I cannot get past the condition step. I already have my Yes/No steps written. Below is how my flow looks right now. I have it as an "object" per Flow, the object "0" I guess. The condition bombs. How can I convert this to an integer so the condition can work with it? I've tried "start with" or "equals" or "greater than" but all conditions fail.
I am unable to even type other functions in the Condition box to do a conversion. I suspect I am supposed to do the conversion before the Condition, but no clue how. Tried int(objRowCount) and that just gave an error.
Solved! Go to Solution.
By the way, this was working before I put in a condition. It would post the object "0" (or whatever the value of the row count was) to Teams successfully using the FlowBot, but I want to suppress the posting if the rowcount is zero. So a but stumped.
Thanks. That solved the condition issue, but then the results of the query were no longer available as dynamic content for the condition action.
So I created a variable, and used your expression above to assign the row count object to the variable, and then report the variable in Teams via the flow bot.
Much appreciated. I'd have never suspect to use "body" to do the conversion.
By the way, if you know of any good Power Query references for Flow I'd appreciate links. I am experienced in Power Query so building one is no problem. Would just like to understand multiple ways to get the results into formats or data types that can be emailed, posted to Teams, etc. I now have scalar values down. Next would be arrays (tables). I've done some googling and didn't see much on it that was useful to my scenario.
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!