I have a simple app that displays a sharepoint list in a table. I have a column in the list with the name "Title". I want to display the table filtered on if the title contains the word "Approved" or "Waiting".
Filter('Online GIS User Account Request List', !IsMatch(Title, "approved", MatchOptions.Contains))
Works when it's one condition.
Filter('Online GIS User Account Request List', !IsMatch(Title, "approved", MatchOptions.Contains) or !IsMatch(Title, "waiting", MatchOptions.Contains))
Does not work when I add the second condition with or
In your example. it looks like you actually want it to only show items where the Title is neither "approved" nor "waiting", so using Or won't get you that as they both allow each other - i.e. if the Title is not approved then it could be waiting or if the Title is not waiting then it could be approved - but what you want (I think) is that neither of the two appear in your datatable.
Filter(
'Online GIS User Account Request List',
!("approved" in Title)
And
!("waiting" in Title)
)
It's worth noting that this formula is not delegable though so it won't work once you are over 2000 items - so can I ask, is your Title equal to "approved" or is there other text inside the Title field? If not, and you have a limited set of potential Title values, then I would suggest using explicit references to the other possible Title names, as this is scalable and will work no matter how many options you add to it:
Filter(
'Online GIS User Account Request List',
Title="Under Review"
Or
Title="With Administrator"
Or
Title="Denied"
Or
Title="Rejected"
)
Cheers,
Sancho
Could you check for the single condition you real get expected data?
Based on your requirement, you want to filter based on approve and waiting, but you add ! before ismatch, and for your second conditon, you should use "Or" instead of "or".
Here is a sample demo:
ClearCollect(
SampleData,
{
Id: 1,
Title: "Approved"
},
{
Id: 2,
Title: "Pending"
},
{
Id: 3,
Title: "Waiting"
}
);
ClearCollect(
FilterSampleData,
Filter(
SampleData,
IsMatch(
Title,
"Approved",
MatchOptions.Contains
) Or IsMatch(
Title,
"Waiting",
MatchOptions.Contains
)
)
);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.