cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Pass the custom vision service an image from powerapps

Hi All, I've built an image classifier in the custom vision service that works great. The problem is how on earth do I pass it images from PowerApps. I've tried to use flow and the requirements are a bit bewildering. Do you know if the custom vision options inside powerapps are working, i cant find an example of the syntax required anywhere. current app flow is add a photo of a leaf in the add media control -> leaf photo added to collection - > then who knows, all i want to do is pass to the classifier ? Any help is greatly appreciated happy new year people

 

so a bit of an update - It turns out that its impossible to pass an image from the add media control, after much research the best way to do it is apparently configure a web service and set up a custom connector to trigger it. so far i've got this. the problem comes when i try pass an image file, i get what i think is a http output that flow opens in a new browser window, and ideas how i can parse it to a json schemaflow and powerapps.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Morning @v-xida-msft,

 

Thanks for your reply, I actually solved this myself after much soulsearching and anguish.

 

I had overlooked the native PowerApps functions for passing an image over to the custom vision service, assuming that they didn't work, when actually they work fine. I used the below formula after setting up the connector.

 

ClearCollect(PredictionOutcome,CustomVision.PredictImag("c56044c48086xx464595d6f28xxecc596axxb",UploadedImage4.Image))

 

this passed my added image to the CV service without the need for flow, I think i was distracted by all the talk in the community about the use of compose functions to handle images.

 

Anyway thanks for your help 

 

all the best

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

i should probably say, I dont know if its relevant, the classifier detects disease in tomato leaves
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

Could you please share a bit more about your issue?

Do you want to pass a image file captured via "Add Picture" control to your flow?

Further, do you want to convert the HTTP output into a JSON format within your flow?

If you want to pass a image file captured via "Add Picture" control to your flow, please check and see if the following blog or video would help in your scenario:

http://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

https://www.youtube.com/watch?v=mp-8B1fLrqs&feature=youtu.be

 

In addition, the HTTP output in your flow is actually a JSON data format. In default, the data output format of the HTTP action (including "When a HTTP request is received" trigger) within MS Flow is a JSON format (application/json).

If you want to convert the HTTP output in your flow into a JSON format, I think it is not necessary.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Morning @v-xida-msft,

 

Thanks for your reply, I actually solved this myself after much soulsearching and anguish.

 

I had overlooked the native PowerApps functions for passing an image over to the custom vision service, assuming that they didn't work, when actually they work fine. I used the below formula after setting up the connector.

 

ClearCollect(PredictionOutcome,CustomVision.PredictImag("c56044c48086xx464595d6f28xxecc596axxb",UploadedImage4.Image))

 

this passed my added image to the CV service without the need for flow, I think i was distracted by all the talk in the community about the use of compose functions to handle images.

 

Anyway thanks for your help 

 

all the best

Hi Team,

 

I am trying to use CustomVision through powerapps. i am getting following error, i dont know why.

 

CustomVision.PredictImage failed: { "error": { "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." } }

 

I am trying to call a customvision using prediction key.

Please help!

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,613)