cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

TAKE OR UPLOAD IMAGES: Best Practices

ehhh!!

Need help with the pattern here...

Use case:

  • Sharepoint data source
  • Form control
  • Ability to create new record and TAKE OR UPLOAD multiple photos
  • Ability to edit existing record and TAKE OR UPLOAD multiple photos AND VIEW / DELETE photos

Issues:

  • Using the Attachments DataCard in the Form is ok for the create new use case BUT
    • In the edit existing use case, I can't show the photos to the user
    • No simple way to pull the Attachments out and show them in a Gallery
    • No simple way for user to delete photos in Gallery and remove them from Attachments in the record
  • Using a second screen for "Take Photo" functionality is where I'm leading, but I can't quite wrap my head around the pattern
    • Should I use a separate Add Picture Control (not the Form Attachments DataCard) and Patch into an Image-type Sharepoint column in the new / existing record?
      • I've been unsuccessful / had inconsistent results in the past Patching to a Sharepoint Image-type column.
    • Should I Patch to a Sharepoint Image Library instead and tie the images to the submitted record via a GUID?
    • Do I absolutely need to use Flow and the JSON() function to do this?

Would really love some clarity here. I feel like there are 100 ways to do this and they keep evolving! @paul_culmsee

Thank you!

3 REPLIES 3
Community Support Team
Community Support Team

Re: TAKE OR UPLOAD IMAGES: Best Practices

Hi @ericonline ,

 

1. You can make the list of attachments show in the edit form screen like this:

Insert a Gallery control, set its Items property to:

BrowseGallery1.Selected.Attachments

Capture.JPG

(I'm using the auto-generated app created from Start from data > SharePoint.)

 

2. For Attachments control, upload and delete functionality work only inside a form. The Attachment control appears disabled when in Edit mode and not inside a form. To save file additions and deletions, the app user must save the form. Because of this limitation, the Attachment control isn't available from the Insert tab but appears in the form when the Attachment form field is enabled in a SharePoint or Common Data Service form.

 

3. So far, you cannot use an Add Picture control to upload images from PowerApps to SharePoint directly. The only workaround so far is to use PowerApps + Microsoft Flow solution. 

Below are some blogs that might help:

https://explore.emtecinc.com/blog/how-to-upload-camera-pictures-directly-to-microsoft-sharepoint-wit...

https://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

http://johnliu.net/blog/2018/7/the-simplest-no-code-solution-to-save-pictures-files-from-powerapps-t... 

https://powerusers.microsoft.com/t5/General-Discussion/Pictures-from-powerapps-to-sharepoint-back-to...

 

Regards,

Mona

 

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

Re: TAKE OR UPLOAD IMAGES: Best Practices

On my website I have blogged extensively insofar as different techniques you can use to render images with your PowerApps applications.

 

Whilst I don't have a specific blog pertaining to your requirements I can tell you that during some of the testing I have done I have successfully used the attachments control on a form "aka your create new use case" which enables you to take photos on mobile devices and / or upload existing photos stored on your phone or desktop web client app as attachments to a list item.

 

When the list item with the attachments is then saved to a list in SharePoint I implemented a Flow that triggers on insert and subsequently transverses through each of the list item attachments as they are uploaded and copies each of the attachments to a SharePoint Document Library / Site Assets library. You could alternatively instatiate the Flow directly from PowerApps after saving the list item for a more responsive solution. 

 

Importantly I added a column on that library to use as a foreign key in order to corrolate which images were related to each list item created (e.g. ID).

 

As the Flow runs and copies each of the list items Attachments to the Document Library I equally delete that attachment from the list item as it is no longer of relevance. 

 

As soon as the images have to moved from being an attachment to a list item to being an actual file stored in a SharePoint Document Library inclusive of the related key property to the corrosponding list item, you can then depict those images in your app and levage standard SharePoint functions such as Remove should you wish to delete the image from SharePoint and the relevant list item.

 

Once the images are stored in a SharePoint Document Library, I have blogged on a number of techniques you can use to render those images within you app such as this one:

 

SharePoint-Powered Thumbnails Have Arrived!

 

 

Super User
Super User

Re: TAKE OR UPLOAD IMAGES: Best Practices

Hi @v-monli-msft , 

I'm trying to implement your solution. Do you know why I don't have gallery.Selected.Attachments available to add to Gallery.Items?

Thank you
image.png

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 19 members 412 guests
Please welcome our newest community members: