Hi all,
Some help needed please.
I have a gallery linked with a collection from an SP list. i am trying to add a few filtering options based on a Check Box value=true but nothing is working as it should.
Here is the basic filter code;
SortByColumns(Filter([@TAXICOL],StartsWith(StaffName, Name1.Text)),"DateReq", If(SortDescending1, Descending, Ascending))
Here is the filter code that allows me to filter based on checkbox, but the gallery doesn't show any items that does not have the value stipulated by the true statement of the checkbox;
SortByColumns(Filter([@TAXICOL],StartsWith(StaffName, Name1.Text),If(BookedYN.Value=true,Booked,"Yes")),"DateReq", If(SortDescending1, Descending, Ascending))
I also need a similar thing to the below code on a similar gallery but nothing works;
SortByColumns(Filter([@TAXICOL], TextSearchBox1_1.Text in StaffName || TextSearchBox1_1.Text in Schedule1 || TextSearchBox1_1.Text in Schedule2 || TextSearchBox1_1.Text in Schedule3), "DateReq", If(SortDescending2, Ascending, Descending))
Hi @VegetA3113
You can use this formula for the items property of the gallery.
With({txc: If(
BookedYN, Filter(
[@TAXICOL],Booked="Yes"
),
[[@TAXICOL]
)},
SortByColumns(
Filter(
txc,StartsWith(
StaffName,Name1.Text
)
),"DateReq",
If(
SortDescending1, Descending, Ascending
)
)
)
This formula starts by creating a temporary table (txc) that is either filtered or not depending on the checkbox status. Since BookedYN is either true or false, no If() statement is required.
The temporary table is then used in the subsequent filter and sort.
With respect to your second issue, I have no idea what you mean by a "similar thing".
Thanik you for your reply.
I actuially managed to get mine to work.
I did try the code but it had quite a few red squiggles, I tweaked it to this, the only error now is the bold =;
With({txc:If(BookedYN_2.Value=true, Filter(TAXICOL,Booked="Yes"),TAXICOL)}, SortByColumns( Filter( txc,StartsWith(StaffName,Name1_2.Text)),"DateReq",If( SortDescending1, Descending, Ascending)))
A checkbox is either true or false. If you are storing your data in some other way, ie. "Yes" instead of true, you will get errors. While you didn't mention it, if your column type is Yes/No, it causes problems, to simplify, make it a single line of text (SLOT) instead and store the actual value provided by the checkbox. The only column types that I use in SharePoint are SLOT, date/time and numbers. The rest cause problems in PowerApps and work-arounds are required.
User | Count |
---|---|
207 | |
92 | |
84 | |
49 | |
41 |
User | Count |
---|---|
255 | |
104 | |
103 | |
61 | |
59 |