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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery from collectio...
Power Apps
Answered

Gallery from collection with Dropdowns

(0) ShareShare
ReportReport
Posted on by 131

Hi all,

 

I have created an app where OnVisible =

ClearCollect(
colMyReports, Office365Users.DirectReportsV2(Label1_1).value, {compPerf:"", hrsPrWk:""}
);

 

I then have a gallery showing that collection with a Slider (0-10) and a Dropdown (Items = ["0", "10", "20", "30", "40"]) in each gallery item.  The Slider's OnChange =


Patch(
colMyReports, ThisItem,{compPerf:Slider1.Value})

Default = ThisItem.compPerf

 

and the Dropdown's OnChange=

 

Patch(
colMyReports, ThisItem,{hrsPrWk: Dropdown2.SelectedText.Value})

 

Default = ThisItem.hrsPrWk

 

So far so good - the collection is created with empty columns for compPerf and hrsPrWeek.  Changing the slider correctly updates the compPerf column per item, but the hrsPerWeek Dropdown of the first gallery item updates all of the items in the gallery (but not in the collection itself - just in the gallery).  All other gallery item dropdowns (aside from the first one) behave as expected, only updating that one item. 

 

Any idea why the first gallery item is populating through all other gallery items ONLY when changing the first one?

 

tx,

 

dh

Categories:
  • Jagadeeshk Profile Picture
    457 on at

    Pls share the steps and screen shots

  • v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @dhalpin ,

    Do you mean when updating the first gallery item’s hrsPrWk property, all other items’ hrsPrWk property also get changed?

    Will hrsPrWk property of all other items get changed inside the collection? Or this issue just happen on gallery, the collection will only update the first item?

    I have done a test on my side with your formula, everything works fine when I edit the first gallery item. Since your formula is correct, I would suggest you try to set OnSelect property of dropdown to:

    Set(varItem,ThisItem)

    v-albai-msft_0-1617592735067.png

    Then check if issue remains.

    Best regards,

    Allen

  • dhalpin Profile Picture
    131 on at

    Hi Allen,

     

    That is correct - when I change the first gallery item's dropdown, all others will change UNLESS they have already been individually changed first.  For example, if I have 5 gallery items and I change the first one, all five will update to match #1.  If I change #3 it will be unique (whatever it is changed to).  If I then change #1 again, all EXCEPT 3 will change to match 1. 

     

    This is only changing in the gallery, not in the corresponding collection that is the data source.  Any dropdowns that are changed (#1 and #3 above) are updated correctly in the collection and the others remain empty, despite showing an updated value in the gallery.

     

    I tried your suggestion of Set(varItem, ThisItem) for the dropdown OnSelect property, but it didn't change anything.  Here is a screenshot which does mention something about "scope" which might be a clue?

    dhalpin_0-1617625614723.png

     



  • v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @dhalpin,

    I forget one step, after set to Set(varItem, ThisItem), change the Dropdown's OnChange=

    Patch(
    colMyReports, varItem ,{hrsPrWk: Dropdown2.SelectedText.Value})

    If still not work, I suggest you clear browser then check again and re-create the collection. I cannot reproduce this strange issue. Everything works fine on my side.

    Best regards,

    Allen 

  • Verified answer
    dhalpin Profile Picture
    131 on at

    Thanks @v-albai-msft 

     

    That didn't work by itself, but I did find a solution!  I start the collection from an 0365.DirectReports list, and for some reason there were some blank records.  So I added an IF() that also specifies the INDEX of the desired Default Dropdown item.  Like this:

     

    If(IsBlank(ThisItem.hrsPrWk) = false, ThisItem.hrsPrWk, 0)

     

    This seems to make the items in the gallery display properly - they no longer change to match the first item.

     

    Thanks for your help!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard