I have the following filter attached to the default property of a gallery control: Filter('[dbo].[tblJobMain]',"ClaimNumber" > 0) but it doesn't work.
I am guessing I have some syntax wrong. All I want to do is return all records in the JobMain table that have a ClaimNumber value greater than 0.
What am I doing wrong?
Thank you you are right. Is there anyway I can use it as a default property? I want to have the seach box wired to my items as follows (which works):
SortByColumns(Search('[dbo].[tblJobMain]', TextSearchBox1.Text, "ClaimNumber","ContactName","ContactTelNo"), "ClaimNumber", If(SortDescending1, Descending, Ascending))
but also default the view to the filter so that only records with a ClaimNumber greater than 0 show on first load.
The Default property of a gallery does not determine what items are initially shown, the Default property determines which item of those shown is initially selected (although there are some issues with this property, so it does not fully work that way).
The Items property solely determines which items are shown. Hence if the desired behaviour is for only records with ClaimNumber greater than zero be initially shown, then that needs to be what is in the Items property. You can implement this for example by using your TextSerchBox1's Default property. This property determines the initial text of the text input.
However, your gallery's current Items property is not set up to deal with that. I am also confused since "ClaimNumber" appears to be a text type field and not an integer.
Assuming it is an integer, then set the Default property of TextSearchBox1 to "" (empty string) and set the gallery's Items property to this:
If( Len(TextSearchBox1.Text)=0, Filter([dbo].[tblJobMain]', ClaimNumber>0), IsNumeric(TextSearchBox1.Text), Filter([dbo].[tblJobMain]', ClaimNumber=Value(TextSearchBox1.Text), Search('[dbo].[tblJobMain]', "ContactName","ContactTelNo") ),
"ClaimNumber", If(SortDescending1, Descending, Ascending)
Please let me know
I have found that almost anything can be done in PowerApps with the appropriate work-around.
In regards to it being a text column, it seems inconsistent with then trying to filter by ClaimNumber>0
Delegation is explained here:
FIll out a quick form to claim your community user group member badge today!
The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!