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

Save Photo Gallery for a Record

Hi,

I have a CDS entity (call it entityMain) and I want to be able to collect a gallery of pictures for it. So I created a new entity (call it entityPictures) for storing the pictures and made a Lookup field to the entityMain.

I have a Gallery (galleryMain) in my app that points to entityMain and a basic 3 screen navigation. I want to be able to select a record in the gallery and from that record's edit screen, add a gallery of pictures to the record.

So I put a camera in the edit screen, set the OnSelect to: Collect(colPix, Camera1.Photo)

Then I added a gallery to the selected record that had Items: galleryMain.Selected.entityPictures

My thinking was that I would add a button that saves the collection to entityPictures, but I need it to apply the proper Lookup value for the record. 

Something like:

ForAll(colPix, Patch(entityPictures, Defaults(entityPictures), {Pictures: Url, entityLookupColumn: galleryMain.Selected}))

 

But this doesn't result in my picture gallery showing up for the record I have selected. 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @SeanHenderson ,

I've made a similar test but my pictures updated successfully.

Here's my test for your reference:

1)my collection:

12107.PNG

 2)my update formula:

ForAll(colPix,Patch(testmanies,Defaults(testmanies),{testone:Gallery2.Selected,penimage:pic}))

 3)my field setting:

12108.PNG

 

Please note that you need to have the full permission of the Note entity. Because all the images will be stored in this entity.

If you do not have the full permission of the Note entity, you can not update successfully.

 

 

 

Best regards,

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

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @SeanHenderson ,

I've made a similar test but my pictures updated successfully.

Here's my test for your reference:

1)my collection:

12107.PNG

 2)my update formula:

ForAll(colPix,Patch(testmanies,Defaults(testmanies),{testone:Gallery2.Selected,penimage:pic}))

 3)my field setting:

12108.PNG

 

Please note that you need to have the full permission of the Note entity. Because all the images will be stored in this entity.

If you do not have the full permission of the Note entity, you can not update successfully.

 

 

 

Best regards,

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

View solution in original post

@v-yutliu-msft 

Okay, I checked the data in CDS and it actually is saving properly. I guess the issue I'm having is displaying that collection of pictures in a gallery.

So if a user navigates to the details screen for a particular record, on that screen is a button that navigates to the gallery of photos associated with that particular record. So on this new gallery screen, I have a gallery with entityPictures as the data source. But how do I set it up to display the pictures associated to the record that was selected in galleryMain?

I thought it was something like:

galleryPictures.Items: Filter(entityPictures, entityMain.entityMainGUID=galleryMain.Selected.entityMainGUID) but this isn't working.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,162)