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

PowerApps Filter Problem

Dear users,

I am trying to build a power app and I feel like I crash on a wall. The Use case is : I want to filter my source ('Master source' in this case a SharePoint list) by Project title and replacement project.

I want to fulfill also 4 scenarios,

  • If both drop-downs are empty
  • If dropdown1 is empty and dropdown2 has a value
  • If dropdown2 is empty and dropdown 1 has a value
  • If both dropdowns have value

And I want it also to filter some fields of my SharePoint list :

  • Type= "Application"
  • TargetDecision= "Migration"
  • Madrid_DB2 = " Madrid and Evonik"
  • Madrid_DB"= "Evonik Only"

 

 

My code is with blue underlined and looks like this:

 

Filter(
'Master Source';

If(
And(IsBlank(Dropdown1.SelectedText.Value);IsBlank(Dropdown2.SelectedText.Value));And(Type="Application"; TargetDecision.Value="Migration"; Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only"));

If(
And(Not(IsBlank(Dropdown1.SelectedText.Value));Not(IsBlank(Dropdown2.SelectedText.Value)));And(Type="Application"; TargetDecision.Value="Migration";ReplacementTechnology.Value=Dropdown2.SelectedText.Value;ReplacementProject_PPM.Value=Dropdown1.SelectedText.Value; Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only"));

If(
And(Not(IsBlank(Dropdown1.SelectedText.Value)); (IsBlank(Dropdown2.SelectedText.Value)));And(Type="Application"; TargetDecision.Value="Migration";ReplacementProject_PPM.Value=Dropdown1.SelectedText.Value; Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only"));
And(Type="Application"; TargetDecision.Value="Migration";ReplacementTechnology.Value=Dropdown2.SelectedText.Value; Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only"))


))))

 

 

I have attached a Pic just to visualize the app. If anyone can help me I would be grateful !!

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: PowerApps Filter Problem

Hi @XT2

Could you share the detailed error information with the formula?

What are the date types of 'ReplacementProject_PPM' and 'ReplacementTechnology' columns? Could you please share the Items property of Dropdown1?

 

This delegation error is seemly caused by the IF function inside the Filter function. So I suggest move the IF function out of the filter function, first to check if the dropdown is blank, and then filter the SP list. Please try this code:

 

If(IsBlank(Dropdown1.Selected.Value); Filter('Master Source'; Type="Application" && TargetDecision.Value="Migration" && Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only")); Filter('Master Source'; Type="Application" && TargetDecision.Value="Migration" && Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only") && ReplacementProject_PPM.Value=Dropdown1.Selected.Value))

 

Best regards,

Sik

View solution in original post

5 REPLIES 5
v-siky-msft
Level 10

Re: PowerApps Filter Problem

Hi @XT2 ,

 

Please try this code:

Filter('Master Source'; Type="Application" && TargetDecision.Value="Migration" && Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only") && If(IsBlank(Dropdown1.SelectedText.Value); true; ReplacementProject_PPM.Value=Dropdown1.Selected.Value) && If(IsBlank(Dropdown2.SelectedText.Value); true; ReplacementTechnology.Value=Dropdown2.Selected.Value))

If this doesn't work, please post back the error screenshots of code, and the date type of these fields.

Best regards,

Sik

XT2
Level: Powered On

Re: PowerApps Filter Problem

Hello @v-siky-msft 

 

Thank you for replying to my post. The costumer decided to change a bit the User Story , so i need to filter the drop-downs in 2 screens. The error that i get is a blue line under the code before the IF Filter('Master Source'; Type="Application" && TargetDecision.Value="Migration" && Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only") && If(IsBlank(Dropdown1.SelectedText.Value); true; ReplacementProject_PPM.Value=Dropdown1.SelectedText.Value))

Powerapp problem.PNG

as far i understand it tells me that my drop-downs are looking in a Table for Information, but it is a SharePoint list behind...

 
XT2
Level: Powered On

Re: PowerApps Filter Problem

Powerapp problem.PNG

v-siky-msft
Level 10

Re: PowerApps Filter Problem

Hi @XT2

Could you share the detailed error information with the formula?

What are the date types of 'ReplacementProject_PPM' and 'ReplacementTechnology' columns? Could you please share the Items property of Dropdown1?

 

This delegation error is seemly caused by the IF function inside the Filter function. So I suggest move the IF function out of the filter function, first to check if the dropdown is blank, and then filter the SP list. Please try this code:

 

If(IsBlank(Dropdown1.Selected.Value); Filter('Master Source'; Type="Application" && TargetDecision.Value="Migration" && Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only")); Filter('Master Source'; Type="Application" && TargetDecision.Value="Migration" && Or(Madrid_DB2.Value="Madrid and Evonik";Madrid_DB2.Value="Evonik only") && ReplacementProject_PPM.Value=Dropdown1.Selected.Value))

 

Best regards,

Sik

View solution in original post

XT2
Level: Powered On

Re: PowerApps Filter Problem

This Formula is working perfectly!! thank you very much!! My data Columns in SP are simple line of text and i Just added a Gallery and a Dropdown that takes the data from those columns and filter them (with other 3 Columns) and gives me the results. Thank you very much 🙂

 

 PowerApp Solution1.PNGPowerApp Solution2.PNG

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,045)