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.
Hi @EdHansberry
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.
Hi @EdHansberry
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.
Hey @EdHansberry
Thank you very much @yashag2255 - I've bookmarked each of these links and will review.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
27 | |
22 | |
15 | |
13 |
User | Count |
---|---|
141 | |
42 | |
42 | |
34 | |
30 |