cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Masoud9
Level: Powered On

Screen that filters the next screen

Hi,

 

I have a sharepoint list in wich I have data of my aircraft fleet. I need my app to do these:

1. A main screen in which I select my location (attached: main screen1)

2. I want a second screen with all the aircrafts located in that place sorted by registration plate (main screen1 style)

3. Also I want a third screen with a browse gallery already sorted by the choice I made in screen 1 and screen 2 (attached: browse screen)

 

My question is: Is there any way to previously filter a screen with my selection in the prior screen?

 

Thank you very much

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Screen that filters the next screen

Hi @Masoud9 

 

Yes this could be achieved by setting up few variables. Please follow below steps:
 
1) Main Screen: You can set a variable with name "SelectedLocation"
 
Screen -> OnVisible: Set(SelectedLocation,"")
 
All the Button for different location:
Spain Button-> OnSelect: Set(SelectedLocation,"Spain")
France Button -> OnSelect: Set(SelectedLocation,"France")
 
2) On the Second Screen, please connect the data source with the data associated to your aircraft registration plate.
Suppose, the DataSource Name is "AircraftRegistration" and this contains a column named "Location"
 
Expression:
Filter(AircraftRegistration, Location = SelectedLocation)
If this data is displayed as a gallery(Gallery1) and based on gallery selected item, the third screen will be filtered.
 
3) Now the third screen, suppose the data source is "AircraftDetails", then your filter query will be modified as:
 
Filter(AircraftDetails,Location = SelectedLocation && AircraftRegistrationNumber = Gallery1.Selected.RegistrationNumber)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
K-A-R-L
Level 10

Re: Screen that filters the next screen

Hi @Masoud9 ,


Try using the Distinct() Function:

In your case:

Distinct(Filter(AircraftRegistration, Location = SelectedLocation), PlateColumnName)

 

This will give the distinct values of Plate that fits the condition in the filter.

 

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

 

Super User
Super User

Re: Screen that filters the next screen

Hi @Masoud9 

 

In that case, you can modify the expression as:
 
Distinct(Filter(AircraftRegistration, Location = SelectedLocation),PlateNumber)
 
With this, your third screen formula will be modified as:
 
Filter(AircraftDetails,Location = SelectedLocation && AircraftRegistrationNumber = Gallery1.Selected.Result)
5 REPLIES 5
Super User
Super User

Re: Screen that filters the next screen

Hi @Masoud9 

 

Yes this could be achieved by setting up few variables. Please follow below steps:
 
1) Main Screen: You can set a variable with name "SelectedLocation"
 
Screen -> OnVisible: Set(SelectedLocation,"")
 
All the Button for different location:
Spain Button-> OnSelect: Set(SelectedLocation,"Spain")
France Button -> OnSelect: Set(SelectedLocation,"France")
 
2) On the Second Screen, please connect the data source with the data associated to your aircraft registration plate.
Suppose, the DataSource Name is "AircraftRegistration" and this contains a column named "Location"
 
Expression:
Filter(AircraftRegistration, Location = SelectedLocation)
If this data is displayed as a gallery(Gallery1) and based on gallery selected item, the third screen will be filtered.
 
3) Now the third screen, suppose the data source is "AircraftDetails", then your filter query will be modified as:
 
Filter(AircraftDetails,Location = SelectedLocation && AircraftRegistrationNumber = Gallery1.Selected.RegistrationNumber)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Masoud9
Level: Powered On

Re: Screen that filters the next screen

Hi @yashag2255,

 

Thank you very much for your answer, is perfect Smiley Happy

But I have a problem with the second screen:

The registration plates appear sometimes several times and I would like to have each plate only once. Is there a way to eliminate duplicate values? 

K-A-R-L
Level 10

Re: Screen that filters the next screen

Hi @Masoud9 ,


Try using the Distinct() Function:

In your case:

Distinct(Filter(AircraftRegistration, Location = SelectedLocation), PlateColumnName)

 

This will give the distinct values of Plate that fits the condition in the filter.

 

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

 

Super User
Super User

Re: Screen that filters the next screen

Hi @Masoud9 

 

In that case, you can modify the expression as:
 
Distinct(Filter(AircraftRegistration, Location = SelectedLocation),PlateNumber)
 
With this, your third screen formula will be modified as:
 
Filter(AircraftDetails,Location = SelectedLocation && AircraftRegistrationNumber = Gallery1.Selected.Result)
Masoud9
Level: Powered On

Re: Screen that filters the next screen

Hi,

 

Many thanks! @yashag2255 It works perfectly Smiley Happy

 

Salamat Po @K-A-R-L  pinaka solusyon! Smiley Happy

 

Best regards,

Javier

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 53 members 4,312 guests
Please welcome our newest community members: