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

How to run AI model using file attached in Power Apps

HI,

My use case is to run an AI model in Power automate flow. However the user needs to add the PDF sample file (on which AI model needs to work) in power apps.

 

Power Apps:

Expression to run Button: 'PowerAppV2->Compose'.Run('Sample Text'.Text,First(Sample.Attachments))

 

svivek_1-1662882568639.png

 

Power Automate V2 trigger where Sample File Will be uploaded from Power Apps. This Sample file will be fed in an AI extractor for extracting data.

 

svivek_0-1662882383346.png

 

However I am getting following error. Pls help how to solve this issue. 

 

{"operationStatus":"Error","error":{"type":"Error","code":"InvalidPredictionInput","message":"The base 64 binary content is missing for input single","properties":{"BackendErrorCode":"InvalidInferenceInput","DependencyHttpStatusCode":"400"},"innerErrors":[{"scope":"Record","target":"single","code":"InvalidRecord","type":"Error","properties":{"MlIssueCode":"InvalidRecord","MlIssueTarget":"single"}}]}}

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @svivek ,

 

Would you like to upload PDF files in PowerApps and then using AI Builder in a Flow to extract information? If so, please flow the steps of the solution in below thread:

Solved: Using Attachment Control to upload to Document Lib... - Power Platform Community (microsoft....

 

In short words, within your Canvas App, using a JSON function to include the file data and pass to the flow, then get the file content use json and dataUriToBinary functions in the flow. Note that it's using PowerApps than PowerAppsV2 trigger in the flow.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @svivek ,

 

Would you like to upload PDF files in PowerApps and then using AI Builder in a Flow to extract information? If so, please flow the steps of the solution in below thread:

Solved: Using Attachment Control to upload to Document Lib... - Power Platform Community (microsoft....

 

In short words, within your Canvas App, using a JSON function to include the file data and pass to the flow, then get the file content use json and dataUriToBinary functions in the flow. Note that it's using PowerApps than PowerAppsV2 trigger in the flow.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,395)