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

Community site session details

Session Id : 7vZwJ1VZAnVWdu2nbb8AC1
Power Apps - Building Power Apps
Answered

Gallery not updating when filtering other gallery until item is physically selected

Like (0) ShareShare
ReportReport
Posted on 9 Aug 2019 16:50:49 by

I have a gallery with a filter attached.  As I filter, the gallery changes and "selects" an item on it's own.  I will call it "soft-selecting" since the user hasn't actually clicked the item.  While filtering, other fields (labels, html-text, etc...) are updated by the soft-selected item.  I also have another gallery that gets updated from a collection based on the selected item.  However, this gallery will not update until the item is "hard-selected".  It's almost like I need a "On Change" action instead on the filtered gallery.

 

Here are my formulas, etc:

The filtered gallery (PeopleGallery) OnSelect:

Set(person, PeopleGallery.Selected);
ClearCollect(emailAndPhones, {
Type: "email", Text: "<a href='mailto:"&PeopleGallery.Selected.email&"'>"&PeopleGallery.Selected.email&"</a>"
}); If(!IsBlank(PeopleGallery.Selected.email2),
Collect(
emailAndPhones, {
Type: "email",
Text: "<a href='mailto:"&PeopleGallery.Selected.email2&"'>"&PeopleGallery.Selected.email2&"</a>"
})); If(!IsBlank(PeopleGallery.Selected.phone_office),
Collect(emailAndPhones,{
Type: "phone",
Text: "<span>Office: "&PeopleGallery.Selected.phone_office&"</span>"
})); If(!IsBlank(PeopleGallery.Selected.phone_cell),
Collect(emailAndPhones,{
Type: "phone",
Text: "<span>Cell: "&PeopleGallery.Selected.phone_cell&"</span>"
}))

Secondary Gallery (EmailAndPhoneGallery): Items = emailAndPhones

 

Things I've tried that didn't work:

  • Setting the default value of PeopleGallery to the First filtered item
  • Using a variable for PeopleGallery.Selected
  • Selecting using Select() the secondary gallery from PeopleGallery (error about not being able to select outside the container)
  • Selecting using Select() the First filtered item in the PeopleGallery OnSelect
  • Creating the collection in EmailAndPhoneGallery Items field (I get an error about using a behavior function here)
  • Creating an "anonymous" collection in the EmailAndPhoneGallery items field (that doesn't seem to be supported)

Any help is appreciated.  Thanks!

I have the same question (0)
  • Community Power Platform Member Profile Picture
    on 30 Nov 2020 at 12:23:07
    Re: Gallery not updating when filtering other gallery until item is physically selected

    Hi there,

     

    I have got the same issue. My intention was to create a collection with a filter to avoid bringing all the records from the database and clearCollect that same collection depending on what is selected in the gallery. This works fine if I "hard-select" the item in the gallery (do the actual "click") but it doesn't work when I filter/search the gallery and the item is "soft-selected". Even if the value of Gallery.Selected.xxx changes automatically I can't fire the event to clearCollect as I got always the "behavior function in a non-behavior property" error. 

     

    I finally had to change the data in my screen and fetch the data from the DB directly with all the conditions instead of using a collection.

     

    It would be nice to trigger an action when a value changes, some sort of "listener". If somebody knows how to do it, please share 🙂

  • Verified answer
    Community Power Platform Member Profile Picture
    on 14 Aug 2019 at 21:26:31
    Re: Gallery not updating when filtering other gallery until item is physically selected

    @v-yutliu-msft I decided to take a different route and created indivdual labels/icons groups that appear if there is data since I know I will never have more than 4 items.  If there's a way to use the Gallery solution in the future, that would be great.  Otherwise, this is good for now.

  • Community Power Platform Member Profile Picture
    on 14 Aug 2019 at 16:46:58
    Re: Gallery not updating when filtering other gallery until item is physically selected

    @v-yutliu-msft How would I set the items formula of Gallery 2 using a Collect() function?  This causes the behavior formula error.  In my first post, I mentioned that a collection is created based on the item from Gallery 1 and that Collection is used as the items for Gallery 2.  Where can I collect the items as the search filter happens so that Gallery 2 gets updated?  I feel like I am missing something.

  • v-yutliu-msft Profile Picture
    on 14 Aug 2019 at 09:47:14
    Re: Gallery not updating when filtering other gallery until item is physically selected

    Hi @Anonymous ,

    Since you set items of gallery2 by using OnSelect prooerty in Gallery1, you need to "select", then the new data of gallery2 is created.

    The key point is "OnSelect" property.

    It will only act when you "select", select on time the action act one time.

    I suggest you set the formula that you use to gallery2's Items.

    Then, it will automatically change according to the selected item of gallery1.

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on 12 Aug 2019 at 15:30:09
    Re: Gallery not updating when filtering other gallery until item is physically selected

    Hi @v-yutliu-msft ,

     

    I am creating a collection in the OnSelect of one Gallery and trying to use it to populate the Items of a second Gallery.  The first Gallery allows the user to type in a filter box and it updates automatically as they type.  A random item in the first Gallery is highlighted (as if selected) as this is happening and labels on the screen automatically update.  However, the second Gallery does not udpate until the user manually clicks on the item in the first gallery.  Even though the labels are updating, somehow the second Gallery is not getting the message to be updated until the item is selected.  Is it even possible to get the second Gallery to update automatically as the list is filtered?

     

    Thanks!

  • v-yutliu-msft Profile Picture
    on 12 Aug 2019 at 05:30:01
    Re: Gallery not updating when filtering other gallery until item is physically selected

    Hi @Anonymous ,

    Do you mean that you can not create a collection in the Items property?

    Since ClearCollect/Collect is a behaviour function, you can not use it in a Items property.

    You could only set this formula to a property about action.

    For example, a button's OnSelect, a drop down's OnChange, ect.

    Here's a doc about behaviour formula for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-formulas-in-depth

     

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473