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

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
v-litu-msft
Community Support
Community Support

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.

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

 

Change Error.PNG

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!

@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?

Anonymous
Not applicable

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

@Anonymous 

 

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

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!

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

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!

Anonymous
Not applicable

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

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.

 

@Anonymous, 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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,402)