cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FryFubar
Level: Powered On

Addding image from Sharepoint attachments

Hi,

 

Does anyone know how, in a custom Sharepoint form app, a user could select an attachment as the image in a "Picture" column?

 

Here's what I've got so far:

 

A Sharepoint list using custom power apps forms

A Column called "Photo", which requires a URL, but renders an image

Custom forms that have the datacard for the Photo column, but currently displaying nothing

Also, I have the attachment data card working, where a user can view current attachments or upload more

 

Here's how the feature might work in my mind:

 

User Creates or Edits a list item and uploads any number of images as attachments. Using the custom form there is a button that allows them to pick the "main" image to display in the Photo column.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Addding image from Sharepoint attachments

 

I have tested with the SharePoint custom form, setting the Attachment.AbsolutURL with the Picture formatted image field would make the attachments available to be displayed under the Custom Form, the saved image will not be displayed under SharePoint list.

 

But this requires the Attachment to be uploaded first.

 

So the user should:
1. Create or Edit an Item with image attachments added,

2. Edit this Item again, select the proper image in a list box, then click update or save.

 

To implement this, please follow the steps below:

1. Format an image field with Picture type, not URL in SharePoint List, name it with Picture,

2. Click Custom Forms under PowerApps option, Add a ListBox control, set the Items property to:

SharePointIntegration.Selected.'{Attachments}'

3. Turn off the SelectMultiple under the ListBox control, set its value to false, then custom the form cards if needed,

4. set Image property of the DataCardValue for the Picture field with:

ListBox1.Selected.AbsoluteUri

5. Navigate to File, save and publish the Custom form.

A reference:

Testing2.gif

 

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Community Support Team
Community Support Team

Re: Addding image from Sharepoint attachments

 

I have tested with the SharePoint custom form, setting the Attachment.AbsolutURL with the Picture formatted image field would make the attachments available to be displayed under the Custom Form, the saved image will not be displayed under SharePoint list.

 

But this requires the Attachment to be uploaded first.

 

So the user should:
1. Create or Edit an Item with image attachments added,

2. Edit this Item again, select the proper image in a list box, then click update or save.

 

To implement this, please follow the steps below:

1. Format an image field with Picture type, not URL in SharePoint List, name it with Picture,

2. Click Custom Forms under PowerApps option, Add a ListBox control, set the Items property to:

SharePointIntegration.Selected.'{Attachments}'

3. Turn off the SelectMultiple under the ListBox control, set its value to false, then custom the form cards if needed,

4. set Image property of the DataCardValue for the Picture field with:

ListBox1.Selected.AbsoluteUri

5. Navigate to File, save and publish the Custom form.

A reference:

Testing2.gif

 

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
FryFubar
Level: Powered On

Re: Addding image from Sharepoint attachments

Amazing work, thank you very much indeed for your help Smiley Happy

FryFubar
Level: Powered On

Re: Addding image from Sharepoint attachments

Small bug with this:

 

Rather than each list item having it's own image, all list items seem to use the same image (last one selected). Is there a way to specify the image remains selected per item?

Highlighted
Nena
Level: Powered On

Re: Addding image from Sharepoint attachments

 GOOD IT WORKED FOR ME Smiley Happy 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Tomorrow, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 223 members 4,104 guests
Please welcome our newest community members: