cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Col5anders
Helper I
Helper I

Filter gallery based on number formula from drop down list

Hello All,

 

I have a situation where I have a SharePoint list (sp_List) that has a column(Number) with numbers ranging from 0-20 and the format of that column is numbers.  In my app, I have a dropdown(dd_Number) with the below data:

 

[">10","<=10"]

 

I want to be able to filter the gallery based on the drop down selection.  So if they chose "<=10", I want it to show only the records that have the number 10 or less in it.  My gallery text input for the number is "txt_Number" and the format is set to "Format.Number".  Here is my filter formula:


If(dd_Number.Selected.Value = ">10", Filter(sp_List, txt_Number.Text > 10), Filter(sp_List, txt_Number.Text <= 10))

 

I get an error message stating "This rule creates a circular reference between properties, which is not allowed.  A property can not reference itself, or other properties affected by its value.".  I also get this error message when I hover over the ".Text" part of "txt_Number.Text":  "Invalid argument type.  Expecting a number value."

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Col5anders 

I think you should reference the NumberColumnName here instead of txt_Number.Text

If(
    dd_Number.Selected.Value = ">10",
    Filter(sp_List, ThisItem.NumberColumnName > 10),
    Filter(sp_List, ThisItem.NumberColumnName <= 10)
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@Col5anders 

I think you should reference the NumberColumnName here instead of txt_Number.Text

If(
    dd_Number.Selected.Value = ">10",
    Filter(sp_List, ThisItem.NumberColumnName > 10),
    Filter(sp_List, ThisItem.NumberColumnName <= 10)
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

View solution in original post

@mdevaney 

 

Holy smokes, that is exactly what I needed to do.  I don't know why I was trying to reference a label instead of the data directly.  Also, I had to use ThisRecord; ThisItem was not showing up as an option, but ThisRecord did exactly what I needed.

 

I really appreciate your fast response and help.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,381)