cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Save Photo Gallery for a Record

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
Highlighted
Community Support
Community Support

Re: Save Photo Gallery for a Record

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

Highlighted
Super User
Super User

Re: Save Photo Gallery for a Record

@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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,742)