cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
GuestOnaQuest
Level: Powered On

Issues when setting 'Default' property of gallery

I have two galleries. DataSource for both is set to 'AssetRisk' which is a CDS entity. First one is used to display list of available records and the second displays details of the selected item from first gallery. I am passing parameter 'ItemId'  via URL and successfully assigning it to a variable in PA (details of deeplinking can be found here😞 

Set(PassedParam, Param("ItemId"))

I can display the desired record in a separate gallery by setting 'Item' property to:

LookUp(AssetRisks, AssetRisk = GUID(PassedParam))

However, what I want to do is to set 'Default' property of a First gallery to display record with 'ItemId' and so that the Second gallery would show the details of that record. I tried setting 'Default' property of First gallery to:

LookUp(AssetRisks, AssetRisk = GUID(PassedParam))

but it didn't have desired effect. Furthermore, even if I use First(AssetRisk) or Last(AssetRisk) in 'Default' propertry of the First gallery it doesn't select nor first neither last record. It is only when I leave 'Default' as blank , then the top record from the list is being selected in First gallery and Second gallery displays details of a record.

 

Any ideas?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Issues when setting 'Default' property of gallery

Hi @GuestOnaQuest ,

Could you tell me the Second gallery's settings?

I've made a similar test but not met the same problem like your description.

Here's my test:

1)set  gallery1's Default: LookUp(list2,Title=2)

        gallery2's Items: Gallery1.Selected

Then, gallery2 display this item by default.944.PNG

 

2)set  gallery1's Default: First(list2)

        gallery2's Items: Gallery1.Selected

Then, gallery2 display first item by default.945.PNG

 

 

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.
GuestOnaQuest
Level: Powered On

Re: Issues when setting 'Default' property of gallery

Long story short, I am using GUID function in default property of the gallery that has a datasource as CDS entity ('AssetRisks'), to be exact: LookUp(AssetRisks, AssetRisk = GUID(PassedParam)) and it does not work.


If I would use the same line of code on 'item' property of view or edit form that has Datasource as the same entity from CDS then the item is displayed.

 

What I did is set property of 'TemplateFill' of a gallery to: If(ThisItem.AssetRisk = Gallery2.Selected.AssetRisk,RGBA(100, 100, 100, 100),RGBA(0, 0, 0, 0)); So when I would select the item from the gallery the color would change. Thus, we are taking second gallery out of conversation. Then I would set the 'default' property to the code that I discussed in first paragraph. Even in this case the default property doesn't work as corresponding item is not selected.

 

Please, try to do the test with CDS entity as datasource and use GUID function as an argument in 'default' property. Those 2 conditions are neccessary in order to satisfy the need of the project.

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 315 members 5,529 guests
Please welcome our newest community members: