cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Unity
Frequent Visitor

Form Processing Model Error - Predict Error

Hi All,


I'm attempting to build a invoice processing workflow, wherein invoices are received via email (PDF attachments) and the workflow collects the data for processing. I've created a model in AI Builder, however, when it comes to my workflow, I can't seem to get the predict function to work successfully. 

I've tried two different process I've found online, but both result in error when testing.

 

String + Attachments

All error.PNG

Error:

Attachments error 2.PNG

 

Attachments only:

Attachments error.PNG

Error:

error.PNG

 

Would greatly appreciate any input on how to resolve this 🙂

11 REPLIES 11
Community Support
Community Support

Re: Form Processing Model Error - Predict Error

Hi @Unity,

 

If you want to get the attachment content bytes of the arrived email, you should add the Get attachment action before. And seems like you want to convert it into Base64, you can use the base64() function, for example:

base64(body('Get_Attachment_(V2)')?['contentBytes'])

Annotation 2020-01-07 093857.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Unity
Frequent Visitor

Re: Form Processing Model Error - Predict Error

@v-litu-msft Thanks for the input, I get this error with that method:

 

Change Error.PNG

Dual Super User
Dual Super User

Re: Form Processing Model Error - Predict Error

Hey @Unity 

 

What did you initially pass in the Attachments only screenshot that you have shared? Note that the attachments content retrieved from the dynamic selector in the When a new email arrives action is already a base64encoded string so you do not need to convert to a base64 again. Can you check and confirm on this one? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Unity
Frequent Visitor

Re: Form Processing Model Error - Predict Error

@yashag2255 

 

I was only copying the instructions I read here in regards to creating the workflow:

 

https://docs.microsoft.com/en-us/ai-builder/form-processing-model-in-flow

 

Should I get rid of the base64encoded sting then?

Westbf
Regular Visitor

Re: Form Processing Model Error - Predict Error

Hi All, 

 

My Flow succeeded with the following Expression:

string(outputs('Get_Attachment_(V2)')?['body/contentBytes'])
Dynamic Content inside string (outputs('Get_Attachment_(V2)')?['body/contentBytes']) is Content Bytes from Get Attachment
No need for base64.
InvoiceAI.PNG
 
kr Chris
Unity
Frequent Visitor

Re: Form Processing Model Error - Predict Error

@Westbf 

 

Thanks for the info, I was wondering if you know what this error I'm getting might be? 

 

Predict Error.PNG

 

I'm running the same string you listed (with the change to 'V3' instead). I don't have the option of 'Content Type' but I do have 'Attachments Content Type' that I'm using.

 

Any suggestions on how I can fix that error?


Cheers

Dual Super User
Dual Super User

Re: Form Processing Model Error - Predict Error

Hey @Unity 

 

You missed a step to get the attachments in the flow. Before the predict action, you need to add the get attachment action of the outlook connector and then you will be able to see the relevant dynamic data. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Unity
Frequent Visitor

Re: Form Processing Model Error - Predict Error

Thanks for pointing that out @yashag2255, I've included that step and built out the rest of my workflow. 

There's an odd thing though, whenever I run it I get the output I want (with all the internal steps showing green), but the "apply to all" shows up as an error. Do you know what might be causing this or how I might fix it?


Cheers

Apply to All Error.PNG

Highlighted
Dual Super User
Dual Super User

Re: Form Processing Model Error - Predict Error

Hey @Unity 

 

I believe you have two attachments on that email. Can you check and confirm? One might be an image or something that is not being read by the flow. In the apply to each, you see the "Next Failed" right, click on that one and you will be able to see more details on the error. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Westbf
Regular Visitor

Re: Form Processing Model Error - Predict Error

C@Unity 

Hi, 

 

Does the process works without the  "Parse JSON" and ""Apply to each 2" steps. 

Guess the error is somewhere in those steps. 

 

What exec. u  doing in "Apply to each 2" ?

 

Cheers

Unity
Frequent Visitor

Re: Form Processing Model Error - Predict Error

Hi @yashag2255 

 

I had a look and you're right, when I look at the next failed, it's a predict issue. 

I'm not receiving multiple attachments in the email, but in the one attachment that is included (a pdf), there are multiple pages. Might that be the issue? Looking that the details in the failed output there is a mention of "Unable to process file. Image document dimensions (103x28) do not meet minimum requirements (530x100)". Originally I trained the model just to consider the first page of the attachments coming in.

 

@Westbf, I didn't create the "apply to each 2" myself, the workflow forced me to do so, automatically, when entering one of the values:

 

Value.png

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,558)