Hi @Tapesh ,
Could you please share a bit more about your issue?
Could you please show more details about the "Status" column in your SP List? Is it a Choice type column or Text type column?
Further, do you want to filter your Gallery items when you press the different status buttons?
If the Status column is a Text type column in your SP List, and when you press the status buttons, you store the corresponding value into the StatusResult variable, I think the formula I provided above could achieve your needs. Please make sure the OnSelect property of these Status buttons to following:
"All" button:
Set(StatusResult, AllButton.Text)
"Pending" button:
Set(StatusResult, PendingButton.Text)
"Approved" button:
Set(StatusResult, ApprovedButton.Text)
....
Try the following formula:
SortByColumns(
Filter(
'Petty Cash & GL Code',
If(
StatusResult = "All" || IsBlank(StatusResult), // Add formula here
true,
Status = StatusResult
),
If(
SearchBox.Text = "" || IsBlank(SearchBox.Text),
!IsBlank('Full Name'),
StartsWith('Full Name', SearchBox.Text)
)
),
"Title",
If(SortDescending1, Descending, Ascending)
)
Or you could also consider compare the Status column with different status value individually:
SortByColumns(
Filter(
'Petty Cash & GL Code',
If(
StatusResult = "All" || IsBlank(StatusResult), // Add formula here
true,
StatusResult = "Pending",
Status = "Pending",
StatusResult = "Approved",
Status = "Approve",
StatusResult = "Rejected",
Status = "Reject"
),
If(
SearchBox.Text = "" || IsBlank(SearchBox.Text),
!IsBlank('Full Name'),
StartsWith('Full Name', SearchBox.Text)
)
),
"Title",
If(SortDescending1, Descending, Ascending)
)
If the Status column is a Choice type column, please modify above formula as below:
SortByColumns(
Filter(
'Petty Cash & GL Code',
If(
StatusResult = "All" || IsBlank(StatusResult), // Add formula here
true,
Status.Value = StatusResult // Modify formula here
),
If(
SearchBox.Text = "" || IsBlank(SearchBox.Text),
!IsBlank('Full Name'),
StartsWith('Full Name', SearchBox.Text)
)
),
"Title",
If(SortDescending1, Descending, Ascending)
)
Please take a try with above solution, then check if the issue is solved.
Note: If you have saved the different status value into the StatusResult variable when you press the different "status" button, I think it is not necessary to compare the Status column with individual status value, instead, you could compare the Status column with the StatusResult variable.
Best regards,