Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Filter Data based on selected value in Option set



I have option set field on one screen based on the value selected in option set I want to filter data in gallery in other screen.


Screenshot of Logic:


Screenshot of Error:



Thanks in Advance

Community Support
Community Support

Re: Filter Data based on selected value in Option set

Hi @vaishalivyas1,


Could you please share more details about which control you are working with?

I suspect here you are working with the Gallery2 control, if this is the case, then the formula should be changed in the following way:

if(DataCardValue5.Selected.OptionValue = 100000000, 
   SortByColumn(filter('Project Task Billing Codes', 
statecode=0 && _cf_projecttaskid_value= Gallery2_1.Selected.cf_projecttaskid),
"cf_name"), SortByColumns(Filter('Project Task Billing Codes',
_cf_projecttaskid_value= Gallery2_1.Selected.cf_projecttaskid),
"cf_name") )

The Error should be caused by refering the own value of the gallery control, and this is not supported.

A control can't have its own items property refering to its own property value.




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

Re: Filter Data based on selected value in Option set

Hi @v-micsh-msft


In Gallery2 I have Project Task and in Gallery2_1 I have Project case. based on value selected in option set on EditScreen1 I want filtered results on Gallery 3. 


Not applicable

Re: Filter Data based on selected value in Option set

I have had similar problems when passing a variable from screen 1 to screen 3 (by using a intermediate screen 2).

I learned to never selfassign any variables: for example don't use -> varExtern : varExtern


Try to use it as follows:

Screen1 : Navigate(Screen2;Fade;{varExtern : 'my assigned variable'})

Screen2 : Navigate(Screen3;Fade;{varExternal : varExtern})

Screen3 : here you can use varExternal

Helpful resources


Microsoft Ignite

This will be a conference that you do not want to miss!


New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (2,927)