cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
water-guy-5
Advocate I
Advocate 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
Super User
Super User

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

Worked perfectly, thanks so much!

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.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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