cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Exclude a document type from Form Processing (Document type: xml)

Hello,

 

I built a flow with AI Builder Form Processing to send notifications in a Teams Channel when an invoice arrives to an email address in pdf format, as follows:

flow.png

 

It works correctly except that in Mexico each invoice is accompanied by an xml document for tax purposes, and when the Apply to Each loop finds this document type I get an error:

 

{"operationStatus":"Error","error":{"type":"Error","code":"InvalidPredictionInput","message":"unable to identify the mimetype input","properties":{"BackendErrorCode":"InvalidInferenceInput","DependencyHttpStatusCode":"400"},"innerErrors":[{"scope":"Record","target":"single","code":"InvalidRecord","type":"Error","properties":{"MlIssueCode":"InvalidRecord","MlIssueTarget":"single"}}]}}

 

Nevertheless, the flow finishes and performs the actions for the pdf document, i.e. reply to the sender if it was approved or rejected.

 

When I test the flow sending the email without the xml file then the flow runs successfully:

error.png

 

How could I exclude the xml document type from the Apply to Each loop to avoid this error?

 

Thanks!

 

Fernando

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @calerof,

 

One thing you can do is add a condition to check that the Attachments Content-Type is equal to application/pdf, and only in that case process the attachment with AI Builder. Here is how the flow looks:


2020-08-21_17-50-44.png

View solution in original post

4 REPLIES 4
Microsoft
Microsoft

Hello @calerof 

 

So when you receive the invoices that is not accompanied by another xml file the flow works perfectly, but if that file comes with an accompanied xml the flow fails.

 

However even with the "Failed" status the flow generates the pdf file required. Is that correct?

Regarding the invoices what is the type of it?

Hi @danielbazetto,

 

Correct. The invoice format is PDF.

F

 

Hi @calerof,

 

One thing you can do is add a condition to check that the Attachments Content-Type is equal to application/pdf, and only in that case process the attachment with AI Builder. Here is how the flow looks:


2020-08-21_17-50-44.png

View solution in original post

Hi @JoeF-MSFT,

 

Thank you very much for your support! That fixed the problem and now runs successfully. 

Attachment_success.png

 

Best regards,

 

Fernando

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (103,649)