In this age of building bots and eliminating needless clicks and such to get employees the info they need faster and more directly, we need all the best practices we can find when creating solutions for users. This post will share a better practice when it comes to getting reliable, fast results from SharePoint lists and libraries that don’t rely on search index configuration or endless view sprawl.
If you’re just here for the quick answer, here it is. For string values, you can simply add this to the end of the list’s URL to filter it as specified.
- Spaces in field names and values: If your value includes spaces, replace them with %20.
- [IntFieldName]: Internal field names (like Client in the example below is actually the original Title column) can be found in List Settings > Column Settings > Select Column > Check URL of column settings page (it contains the internal field name following &Field=).
If you want to learn about how this came up in my work and why I chose it as a solution, read on.
Recently, I was involved in troubleshooting a bot that would search a SharePoint list using its built-in search box. However, the bot would be searching for items that were created minutes prior and the search index hadn’t updated yet so no results would be found and the bot would fail to complete.
So I suggested we filter instead of search.
Filtering lists works independently of the search index. Meaning I can create a new item in a SharePoint Server 2019 (or any SharePoint version) list right now and then filter the list and find that new item immediately. But if I search immediately, it won’t be found yet.
Want to argue about continuous crawls as workaround? Send your thoughts to firstname.lastname@example.org.
Changes to the process
For this particular bot, we’d be replacing this process:
- Navigate to SharePoint list URL
- Activate list’s search box
- Enter/type search term (unique item identifier guaranteed to return one result)
- Hit enter/search
with this one:
- Create a variable for the search term
- Navigate to SharePoint list URL with added URL parameter including variable from step 1 (taking us directly to the single result we needed)
It not only simplifies the steps involved, but reduces the likelihood that changes to UI elements will break our bot along the way.
Potential use cases
- Sending workflow emails with direct links to lists and libraries already filtered
- Reducing the number of views on a list by having users bookmark URLs including the filter parameters the view would have
- Improving bot reliability by eliminating some UI-dependent steps
- Eliminating search indexing delays for users or bots searching for new items
- Setting a hyperlink column on a list automatically to filter the list/library by that item’s vendor/client/topic/etc. for easy comparison/drilldown (see how to set a hyperlink column using Power Automate)
How to do it
First you need to identify the internal field name of your column on which you’ll be filtering. Then we simply add a bit of text to the end of the list’s URL.
- Go to Settings > List settings (or List/Library > List/Library Settings in classic views).
- Select the column to filter from under Columns.
- Check the URL for the text following &Field= for the internal field name. Note this somewhere as we’ll need it soon.
- Go back to your default list view ending in .aspx and add the following to the end of the URL, replacing [IntFieldName] with the field name you got in the previous step:
- Now add the following to the end as well, replacing [FieldValue] with what you’d like to use to filter the column referenced in steps 3-4.
- Your final URL may resemble the following:
Filtering yes/no or true/false values
If your filter isn’t working for yes/no columns, replace “no” with 0 and “yes” with 1 in your URL.
Multiple field filters
You can filter the list on multiple columns by adding &FilterField2=… in the same format as the first. See below for an example:
Be sure to check out this documentation for more URL filtering ideas and uses.