Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Issues when setting 'Default' property of gallery

(0) ShareShare
ReportReport
Posted on by 22

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?

Categories:
  • GuestOnaQuest Profile Picture
    22 on at
    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.

     

  • v-yutliu-msft Profile Picture
    on at
    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,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1