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

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

4 REPLIES 4
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!

ganeshsanap
Memorable Member
Memorable Member

@water-guy-5 You can now Create an Image Column in SharePoint/Microsoft Lists and use it instead of using Hyperlink/Picture column or multiple lines of text column.

 

SharePoint/Microsoft Lists image columns now also supports displaying images in power apps, adding/updating images from Power apps and Power automate:

  1. Power Apps can now display images from SharePoint Online/Microsoft Lists 
  2. Add, update, or delete images in SharePoint/Microsoft Lists using Power Apps 
  3. Add an image to SharePoint Image columns using Power Automate 

Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,973)