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.

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
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 (5,114)