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 / Linking galleries on d...
Power Apps
Answered

Linking galleries on different screen

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I have two galleries on two different screens that I would like to 'link', i.e. when I select one record on one gallery, the same record is selected when I switch to the gallery on the second screen. Is there a way to do this? 

 

I have the following "Items" formula already in place for the galleries to filter them to display the required records: 

Sort(Filter([SP List], FormStatus= "Complete" And Phase.Value = Dropdown1.Selected.Value), Title)

 

Thank you!

Categories:
  • Verified answer
    BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    Are the Galleries fed by the same data? If so in the OnSelect of gallery one Set(varSelected, ThisItem.Selected). For the Default of the other gallery use Lookup(yourList,ID=varSelected.ID). You may need to add a Reset(galleryName) to make sure it registers the change correctly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Brian,

     

    Both galleries are fed by the same sharepoint list, but this solution doesn't seem to be working for me. I get an error when I try to set the default value of the second gallery. I did include a Reset(Gallery) function for the button that navigates between screens.

     

    I tried changing the first OnSelect property to Set(varSelected, GalleryName.Selected) which seemed to get rid of the error in the second gallery's default property. But now no item is selected when I switch to it, where previously the last selected record would be highlighted.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    I am assuming you want the 2nd gallwry to have the same item selected and also scrolled to that item based on the item selected in the 1st gallery on the 1st screen. Is that correct? 

     

    If so, I would try a slight modification. On the OnSelecr of the button on Screen 1, use

     

    Set(varSelected, Gallery1.Selected); Set(varDefault, First(Gallery1.AllItems)); Set(varDefault, varSelected); Reset(Gallery2)

     

    Set the default of the 2nd gallery to varDefault. 

     

    Let me know if this doesn't work. If so, just for testing, add this button on the 2nd screen and see if that helps. If it does, then keep the 2nd button in place and add Select(Button2) on the OnVisible of the 2nd screen and simply use the 1st screen to navigate to the 2nd screen using 

     

    Navigate(Screen2)

     

    If rhis also doesn't work, add a timer to the 2nd screen. Set its duration to 500. Set AutoStart to true. Set its OnTimerEnd to 

     

    Reset(Gallery2)

     

    And the Button2's OnSelect to

     

    Set(varSelected, Gallery1.Selected), Set(varDefault, First(Gallery1.AllItems)); Set(varDefault, varSelected); Navigate(Screen2)

     

    Let me know if none of these work. 

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

     

    Thanks!
    Hardit Bhatia
    Microsoft Business Applications MVP
    https://thepoweraddict.com

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Hardit,

     

    None of those solutions seem to be working unfortunately. No items are selected when I navigate to the screen with the second gallery, even after implementing these methods.

     

    Anuja

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I just tried it om my end and it works correctly. Could you try starting a new app, adding 2 screens with galleries. See if that works - there could be something else interfering with the selection

  • rebeccas Profile Picture
    2,591 on at

    On the first Gallery you will have an icon or something that you put the OnSelect = Set(varSelected, ThisItem.ID)

     

    Then click on it to set the variable

     

    The second Gallery will be Filter(SharePointList, ID=varSelected)

     

    But do you want the second Gallery to still show everything but just have the item selected from the first? 

     

    If so, instead of the Filter above for Gallery 2 you would have the Items just as the same as Gallery 1 and the Default for Gallery 2 would be LookUp(SharePointList, ID=varSelected)

     

     

     

     

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

    Hi @Anonymous ,

    Are the two Galleries Items property set to same Filter formula?

     

    Set the OnSelect property of the first Gallery to following:

    Set(SelectedID, ThisItem.ID)

     

    Set the Default property of the second Gallery in your other screen to following;

    LookUp(
     '<Type the formula you set within the Items property of the second Gallery here>', 
     ID = SelectedID
    )

    Set the TemplateFill property of second Gallery to following:

    If(ThisItem.IsSelected, RGBA( 255, 235, 205, 1 ), RGBA(0, 0, 0, 0)) // Highlight the selected item

    Note: Make sure the two Galleries are connected to same SP List on your side.

     

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard