web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Issues when setting 'D...
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:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    on at

    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,

  • GuestOnaQuest Profile Picture
    22 on at

    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.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard