cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndrewMWolfe
Frequent Visitor

"Add Picture" to Gallery then Gallery to SharePoint Photo Library

Noob to PowerApps here. Need help!

In my app, jobsite superintendents will take stock of a project (percent complete, etc.), enter their observations, and then upload site photos as a last step.

I already made a working app using the Camera control that uploads to a SharePoint List column. I thought I would now update to the Add Picture control for better quality photo experience (zoom, focus, high-res, higher quantity of photos). But this is not going at all smoothly. I've spent ... many hours on this and am desperate.

I've scrapped the idea of a photo column in the SP list and even of patching to SP list attachments. Instead, all I want to do now — and it seems like it should be simple — is to wire up an "Add Picture" control to my SharePoint Photo Library called Jobsite_Photos. Ideally it would pass by a gallery at the bottom of the screen where users can delete photos before clicking an Upload button that sends everything up to the Photo Library. I'm tearing my hair out at this point.

Here's what I have, with comments.

Code:

- SnapPicButton.OnSelect: Collect(MyPix, AddMediaButton1.Media)
- Gallery2.Items: MyPix
- Gallery2.OnSelect: Navigate(EnlargedPhotoScreen)
- EnlargedPhotoScreen > Image3.Image: Gallery2.Selected.Value
- EnlargedPhotoScreen > IconTrash2.OnSelect: Remove(MyPix, Gallery2.Selected); If (IsEmpty(Errors(MyPix, Gallery2.Selected)), Back()); Reset(Gallery2)
- SubmitPicsButton.OnSelect: ForAll(MyPix, Patch(Jobsite_Photos, Defaults(Jobsite_Photos), {Name: First(Sort(Weekly_Reports, Timestamp, Descending)).'Project No' & " " & Today()})); Navigate(BrowseScreen)

Notes:

- Jobsite_Photos is my SharePoint Photo Library.
- Weekly_Reports is my SharePoint List of jobsite observations.
- In the screen previous to this, users save their observations and submit them through a form to the SharePoint Weekly_Reports list. With this submit button for photos, I'm calling up the most recently saved record and then using that record's "Project No" with today's date as the name of the photo.

Problem:

- Photos show in the gallery successfully.
- Enlarged photo does not show (and therefore cannot be deleted).
- Upload does not work.

What am I doing wrong?

Thanks so much for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
AndrewMWolfe
Frequent Visitor

I'm not sure the etiquette around answering my own questions, but I don't want to leave the question up for someone to torture over it when I've found an answer.

 

This video helped me enormously: https://www.youtube.com/watch?v=kQVYid1p_vA . It's the only thing that helped, after scouring the internet for days. It uses a SharePoint Document Library, not a Photo Library, but it worked.

 

I was a bit daunted by the JSON schema in the middle, but it wasn't that hard. The video's method doesn't allow the editable photo collection, but that's okay — the core functionality runs.

View solution in original post

2 REPLIES 2
AndrewMWolfe
Frequent Visitor

I'm not sure the etiquette around answering my own questions, but I don't want to leave the question up for someone to torture over it when I've found an answer.

 

This video helped me enormously: https://www.youtube.com/watch?v=kQVYid1p_vA . It's the only thing that helped, after scouring the internet for days. It uses a SharePoint Document Library, not a Photo Library, but it worked.

 

I was a bit daunted by the JSON schema in the middle, but it wasn't that hard. The video's method doesn't allow the editable photo collection, but that's okay — the core functionality runs.

View solution in original post

Hi AndrewMWolfe, 

 

I see that you have under control the App.

Do you have any question or concern?

 

Thanks for sharing the solution.

 

Regards,

Javier

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,042)