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

Filter Gallery based on another list values

I have one list which has the following values-

List A-

All ideas, Project-Regional, Project-Global and Unassigned.

 

The interactive gallery has the following information

Date:02-Sep-2018               Project global

Description of project

Requested Date-20-Aug-2018

Assigned to-Name

 

I would like to filter the interactive gallery based on the list A values, here is my code on OnSelect property but this code is not working as expected, only All ideas (1st option) seems to work. I am not getting any syntax error but not sure why this does not work.

If(Title3.Text="All Ideas",SortByColumns(Filter(Ideas,Status.Value<>""),"Created",Descending),Title3.Text="Project global",SortByColumns(Filter(Ideas,PType.Value="Project global)))"),"Created",Descending))

 

Regards,

Bhaskar 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filter Gallery based on another list values

Hi @bazz12,

 

Do you type the formula that you provided within the OnSelect property of a control?

 

The SortByColumns function is used to sort a table based on one or more columns, and the result this funciton returned is a table. You could not type this function within the OnSelect property of a control. On your side, you should type the formula (that you provided) within the Items property of the Interactive Gallery (Gallery control).

 

More details about SortByColumns function within PowerApps, please check the following article:

SortByColumns

 

In addition, I think there is something wrong (syntax error) with the formula that you provided. Please modify your formula as below:

If(
Title3.Text="All Ideas",
SortByColumns(Filter(Ideas,Status.Value<>""),"Created",Descending),
Title3.Text="Project-Global",
SortByColumns(Filter(Ideas,PType.Value="Project-Global"),"Created",Descending)
)

More details about the If function within PowerApps, please check the following article:

If function

 

 

Please take a try to type the following formula within the Items property of your Interactive Gallery:

If(
  Title3.Text="All Ideas",
  SortByColumns(Filter(Ideas,Status.Value<>""),"Created",Descending),
  Title3.Text="Project-Global",
  SortByColumns(Filter(Ideas,PType.Value="Project-Global"),"Created",Descending),
Title3.Text="Project-Regional",
SortByColumns(Filter(Ideas,PType.Value="Project-Regionala"),"Created",Descending),
... )

then check if the issue is solved.

 

Best regards,

Kris

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.

View solution in original post

Highlighted
Frequent Visitor

Re: Filter Gallery based on another list values

Thank you Kris for the suggestion and it worked very well.

View solution in original post

3 REPLIES 3
Highlighted
Microsoft
Microsoft

Re: Filter Gallery based on another list values

Please note that in your case the nested "If" formula should have the following form:

If(P = V1, Result1, If(P2 = V2, Result2), Result3)

Please see more information here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

Highlighted
Community Support
Community Support

Re: Filter Gallery based on another list values

Hi @bazz12,

 

Do you type the formula that you provided within the OnSelect property of a control?

 

The SortByColumns function is used to sort a table based on one or more columns, and the result this funciton returned is a table. You could not type this function within the OnSelect property of a control. On your side, you should type the formula (that you provided) within the Items property of the Interactive Gallery (Gallery control).

 

More details about SortByColumns function within PowerApps, please check the following article:

SortByColumns

 

In addition, I think there is something wrong (syntax error) with the formula that you provided. Please modify your formula as below:

If(
Title3.Text="All Ideas",
SortByColumns(Filter(Ideas,Status.Value<>""),"Created",Descending),
Title3.Text="Project-Global",
SortByColumns(Filter(Ideas,PType.Value="Project-Global"),"Created",Descending)
)

More details about the If function within PowerApps, please check the following article:

If function

 

 

Please take a try to type the following formula within the Items property of your Interactive Gallery:

If(
  Title3.Text="All Ideas",
  SortByColumns(Filter(Ideas,Status.Value<>""),"Created",Descending),
  Title3.Text="Project-Global",
  SortByColumns(Filter(Ideas,PType.Value="Project-Global"),"Created",Descending),
Title3.Text="Project-Regional",
SortByColumns(Filter(Ideas,PType.Value="Project-Regionala"),"Created",Descending),
... )

then check if the issue is solved.

 

Best regards,

Kris

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.

View solution in original post

Highlighted
Frequent Visitor

Re: Filter Gallery based on another list values

Thank you Kris for the suggestion and it worked very well.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,319)