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

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
Community Support Team
Community Support Team

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
bazz12
Level: Powered On

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
Microsoft dinusc
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

Community Support Team
Community Support Team

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
bazz12
Level: Powered On

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
thirdimage

New Badges

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

Top Solution Authors
Top Kudoed Authors
Users online (5,575)