cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Linking galleries on different screen

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: Linking galleries on different screen

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.

View solution in original post

7 REPLIES 7
Highlighted
Responsive Resident
Responsive Resident

Re: Linking galleries on different screen

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.

View solution in original post

Highlighted
Frequent Visitor

Re: Linking galleries on different screen

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.

Highlighted
Super User II
Super User II

Re: Linking galleries on different screen

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

Highlighted
Frequent Visitor

Re: Linking galleries on different screen

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

Highlighted
Responsive Resident
Responsive Resident

Re: Linking galleries on different screen

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

Highlighted
Super User
Super User

Re: Linking galleries on different screen

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)

 

 

 

 

Highlighted
Community Support
Community Support

Re: Linking galleries on different screen

Hi @adas10 ,

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,069)