Title: PowerApps Image to SharePoint
Description: This Flow will allow you to take an image uploaded from PowerApps with the Image control and upload it to a SharePoint Document library using the JSON function in PowerApps.
Detailed Instructions: In your PowerApp, you need to convert your image to JSON so that you can pass that JSON to Flow. Insert an Add an Image Control in PowerApps and add a button with the following formula:
Collect(
image,
{
picture: UploadedImage1.Image,
Name: Rand() & ".jpg"
}
);
Set(
varJSON,
Json
JSON(
image,
JSONFormat.IncludeBinaryData
)
);
Set(
imageLink,
JSONtoImage.Run(varJSON).imagelink
);
The first formula will take your uploaded image and add it to a collection with the file and the name of the file. The second formula takes the image from the collection, converts it to JSON and assigns it to a variable. The final formula is executing the Flow, passing in the JSON to the Flow and is setting the newly created link to the image in a variable.
Questions: I am open to answering questions about this Flow. Please ask right here as a reply.
Anything else we should know: This is a great solution to take your images from PowerApps and upload them to SharePoint.
watch?v=zbOfgdrRRrk
Many thanks for this.
I'm using it for the text recogniser AI.
I've got the flow working, however it is creating two files, and neither seem to be valid jpeg files.
Powerapps is giving this error:
(deleted)
(deleted)
apologies, missed the datauri to binary step. Image is saving succesfully
I'm still getting two copies of the receipt (not sure why). asside from that everything seems to be working fine, but I'm still getting the error showing in powerapps
looking at this a bit more, I am getting the flow running twice, seconds apart, which is creating the two copies. I presume this is something to do with the onChange property of the text recogniser button.
I have solved this by moving the code to the form submit button.
Great video! I'm actually using something similar to this in a custom form I have for a SharePoint. My form saves and image and I use JSON to parse it and then save to SharePoint. I do have a problem somewhere in my Flow in where the JSON is not converting to an image file when I add the file to SharePoint list. It saves the JSON content to list, not the actual file. However, when I go through the same process and add the image file to a SharePoint library everything works fine. Is there an issue with saving to a SharePoint list vs. SharePoint library? Is there a work around? Am I missing something?
Thanks in advance.
DS