cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SKH19
Level 10

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

Re: Save Photo Gallery for a Record

Hi @SKH19 ,

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

Re: Save Photo Gallery for a Record

Hi @SKH19 ,

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

SKH19
Level 10

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,978)