cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
water-guy-5
Helper I
Helper I

How to upload an image to sharepoint column

I have a functioning power app that uploads to a sharepoint list with about 40 columns. I have a "Submit Form" button at the bottom that performs the submit(form) function OnSelect. I would like the option to "Upload Image" to the sharepoint list as well.

1) What sort of column does this need to be on the sharepoint list? I would like it to just be a hyperlink...
2) Getting the "Upload Image" into the form is simple, but how do I get the "Submit Form" button to also include the uploaded image?
3) Does the default column "Attachments" come into play?

1 ACCEPTED SOLUTION

Accepted Solutions
v-chenzhi
Community Support
Community Support

Hi @water-guy-5,

 

According to your description, I think the Multiple lines of text column in SharePoint is suitable.

I have a test on my side, please try the following workaround:

I created a Multiple lines of text named picture in SP and Add picture control in canvas.

Set the OnSelect property of AddMediaButton to following:

Set(VarPic,Substitute(JSON(UploadedImage.Image,JSONFormat.IncludeBinaryData),"""",""))

Set the Update property of picture_DataCard

VarPic

The uploaded picture will be saved in the picture column as binary text like this:

vzhichen_0-1635415887712.png

The attachment column in SP is also an option, but it has a size limit on the uploaded file, Currently there is a limit of 10 MB.

 

Best Regards,

Zhi Chen

View solution in original post

3 REPLIES 3
Digital
Impactful Individual
Impactful Individual

The usual way of getting images into SharePoint from Power Apps is to use Flow to create an image file in a document library. You can set the Flow to update metadata of the file to link back to your SharePoint item and return the URL of the image to Power Apps as a parameter that you can patch to a SharePoint column.

 

Shane Young and Reza Dorrani have good tutorials on YouTube explaining the process.

 

Matthew Devaney has written a good blog post on the subject. It is for all files but the same concept can be applied to uploading photos.

 

https://matthewdevaney.com/power-apps-easiest-way-to-upload-files-to-a-sharepoint-document-library/

v-chenzhi
Community Support
Community Support

Hi @water-guy-5,

 

According to your description, I think the Multiple lines of text column in SharePoint is suitable.

I have a test on my side, please try the following workaround:

I created a Multiple lines of text named picture in SP and Add picture control in canvas.

Set the OnSelect property of AddMediaButton to following:

Set(VarPic,Substitute(JSON(UploadedImage.Image,JSONFormat.IncludeBinaryData),"""",""))

Set the Update property of picture_DataCard

VarPic

The uploaded picture will be saved in the picture column as binary text like this:

vzhichen_0-1635415887712.png

The attachment column in SP is also an option, but it has a size limit on the uploaded file, Currently there is a limit of 10 MB.

 

Best Regards,

Zhi Chen

View solution in original post

Worked perfectly, thanks so much!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,513)