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

Prediction in Flow between a Form Processing Model and SharePoint

Hi,

 

I am working on a flow between a Form Processing Model in AI builder and SharePoint! When I use the prediction in the flow for my model I do not get the "request payload" fill in. I need to fill in the "document type" and "document" and I can see that it depends on the model I choose I get different fill ins. So I am wondering if you know how to fix it?  guess it has something to do with my model...

 

Best regards,
Ina

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @ina.

 

Do you know the size of the image you are adding to the SharePoint folder that is triggering the flow?

 

If you take that same image from SharePoint and do a quick test, do you get results?

 

2020-03-03_19-20-13.png

 

 

View solution in original post

10 REPLIES 10
JoeF-MSFT
Power Apps
Power Apps

Hi @ina,

 

Thanks for posting the question.

 

Since early February 2020 there is no request payload to fill in the predict action, instead you now specify the Document type (image/jpeg for jpeg images, image/png for png images or application/pdf for pdf files) and the content of the form to analyze on the Document field.

You can find detailed documentation on how to use your form processing models in Power Automate here: https://docs.microsoft.com/en-us/ai-builder/form-processing-model-in-flow

You can also quickly get started using the following Power Automate template: https://us.flow.microsoft.com/en-us/galleries/public/templates/da60c101494a4083b292e327f2443/click-a...

 

For my knowledge, can you let me know where you have seen instructions referring to request payload?

 

Let us know if this helps or we can further assist!

Hi @JoeF-MSFT,

Thank you a lot for the answer!
I actually tried that but for some reason it doesn't work out if the trigger is "When a File is Created" in a folder (SharePoint), but as soon as I try it with the trigger "Manually Trigger a Flow".

If I use "When a File is created" as a trigger and then the "Predict" as an action the Flow Checker does not come up with any error or warning but when I test it the run fails for the "Predict" as you can see on the picture below. 

TestTest

 

I saw the instructions for the request payload here: https://www.youtube.com/watch?v=2vnKw-w9EUM

Hi @ina,

 

Thanks for the update. When you go to flow edition mode can you expand the Predict action and share a screenshot? As well as copying and pasting the error message in the Predict action?

 

Your flow should look something like this:

 

2020-03-03_16-49-52.png

Hi @JoeF-MSFT,


Here you can the the flow:

Flow1.PNG

And here you can see the outcome: 

Flow.PNG

It looks like the error message is within the "body", so here is a copy of that:
{
"error": {
"code": "0x80040265",
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"DependencyFailure\",\"message\":\"Failure while calling FormUnderstanding GetAnalyzeOperationObjectAsync.\",\"properties\":{\"BackendErrorCode\":\"InternalServerError\",\"DependencyHttpStatusCode\":\"500\"}}}",
"innererror": {
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"DependencyFailure\",\"message\":\"Failure while calling FormUnderstanding GetAnalyzeOperationObjectAsync.\",\"properties\":{\"BackendErrorCode\":\"InternalServerError\",\"DependencyHttpStatusCode\":\"500\"}}}",
"type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
"stacktrace": " at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext, Dictionary`2 optionalParameters)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Execute(OrganizationRequest request, ExecutionContext executionContext)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.ExecuteOperation(CrmODataExecutionContext context, EdmOperation edmOperation, Dictionary`2 parameters, Dictionary`2 boundParameters)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.ProcessOperationRequest(String operationName, Dictionary`2 operationParameters, EntityReference entityReference, String boundEntityName, String boundEntityType)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.<>c__DisplayClass11_0.<PostBoundAction>b__0()\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
 
Best regards,
Ína

Thanks @ina.

 

Do you know the size of the image you are adding to the SharePoint folder that is triggering the flow?

 

If you take that same image from SharePoint and do a quick test, do you get results?

 

2020-03-03_19-20-13.png

 

 

View solution in original post

Hi @JoeF-MSFT ,

There you go - I didn't get any result!

So what I am doing is that I am using a canvas app to capture an image that then is transferred to a SharePoint list so that it is possible to have an overview of all the captured pictures there. Then the pictures go to the Form Processing Model and that then identifies the key values and delivers either back to the SharePoint list or as a message to Microsoft Teams. 

The pictures are within the size scope, usually between 17 - 55 KB!

However, the dimensions are not within the scope so that's probably why the error showed up! Because, when I changed the dimensions I could run the quick test and got a result. So then My question to you is, do you know how I can change the dimensions so that the image from the app is within the scope? (I read that it is possible if you have tablet layout, but I am not sure and can't find where I should change the dimensions if I have a phone layout)

 

Size.PNG

 

Best regards,
Ína

Hi @ina,

 

How are you capturing the image in the canvas app? With the camera control? And then, how are you transferring it to your SharePoint list?

Hi @JoeF-MSFT ,

 

Yes, I am using the camera control within the app to capture the image and then I have one button saying "Send to SharePoint" which is then done with a flow. The flow consists of Power App as a trigger, then the action "Convert to Binary Image" and last an action "Create File (SharePoint)"

 

Best regards,
Ína

Hello again @ina,

 

Currently the camera control image resolution is set to 640x480. You can vote the idea proposal to increase these limits for the team to consider: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Camera-Image-Resolution/idi-p/34977

 

What you can use today is the Add picture control that will make use of your device camera native resolution. The following blog post explains well how to achieve this: http://www.cleverworkarounds.com/2019/06/08/getting-pics-to-sharepoint-from-powerapps-is-getting-eas...

 

Hope this helps!

Thank you so much for the help @JoeF-MSFT!
I will definitely vote for that 🙂

 

Best regards,
Ína

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,432)