Notifications
Announcements
Hello
I have created the below which reads invoice attachments sent via email and extracts certain fields such as invoice number etc and stores the data into a SharePoint list. I have tried placing a condition as a test after the "extract info" step (currently not showing) to only update SharePoint if the invoice number was below a certain number but it skips updating SharePoint but doesn't return an error on the flows page. Please can someone advise where i'm going wrong? Apologies if i don't reply as going on a/l returning 10/10.
There are lots of reasons why that condition (the invoice number logic) might be returning false when you expect it to be true.
What I normally do when I am debugging something like that is I add a Compose step just before the Condition. I then copy the value I am checking in the Condition and paste it into the Compose. Then I run a test execution of the flow. It will still behave the same way (Compose should change nothing), but now in the flow execution record you will be able to click on the Compose step and inspect the value. This is usually a very helpful first step in debugging.
Give this a try, then let us know if it helps!
Thanks for the reply @cchannon
So i added a compose step (using the Invoice number value from my AI builder) before my 2nd condition as below:
So i would expect the flow to skip updating my SP list as the invoice number value detected on the email attachment is below 2 mil. Instead i got the below error saying condition 2 has failed. I don't get why it's complaining that my parameter types don't match?
Yeah, what you're seeing there is just inconsistency from PowerAutomate in how it present data types. It doesn't put quotes around strings so it can be easy to think they are numbers when they aren't. In your compose, try wrapping the input in the function Int() to force Power Automate to read it as a number, then use the output of your Compose as the input in your Condition.
Do i use the conversion function for Int as below within my compose? If so how do i place my parameter invoice value from my AI model into that as when i type invoice number value nothing comes up?
Yes, that's the one. So this is another quirk of Power Automate: the two tabs (Expression and Dynamic Content) give you different capabilities. Expression is where you find functions and operations, but you cannot find variables there. Dynamic Content is where you find variables, but you cannot find functions there.
So what you do is pick the Int expression, put your cursor inside the parenthesis, then go over to the Dynamic Content tab and insert your variable.
So just tried your suggestion but got the same error with condition 2 as above.
Did you use the Compose output in Condition 2 instead of Invoice Number?
No i didn't (see below) 😬
So i should you use the same input in the compose and replace the invoice number value in condition 2. Will give it a try and let you know. Thanks for your continued help 🙂
@cchannon Got to say a big thanks for all your help on this and i've now learnt some of the quirks of Power Automate 😉 It's now working as i expected.
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 721 Most Valuable Professional
Michael E. Gernaey 320 Super User 2025 Season 2
Power Platform 1919 268