SP List Columns filter doesnt work with calculated fields

Shri-6058 326 Reputation points
2021-07-09T16:56:48.677+00:00

Hello,
The following filter works for single line of text, multiline text however the calculated field merging other text columns doesn't work
Example:
http://spportal/Lists/TestList/AllItems.aspx?FilterName=comment1&FilterMultiValue=Test2 - Comment1- Single Text - works fine
http://spportal/Lists/TestList/AllItems.aspx?FilterName=comment2&FilterMultiValue=Test1 - multiline text - works fine
http://spportal/Lists/TestList/AllItems.aspx?FilterName=comment3&FilterMultiValue=Test3 - calculated field storing two column text values however the query throws error:

Exception from HRESULT: 0x80131904
Correlation ID:eee5d99f-5caf-c080-0a76-7e173e889321

Please advice on how to filter calculated field(storing single line text)

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,217 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,607 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JoyZ 18,041 Reputation points
    2021-07-12T09:32:53.933+00:00

    @Shri-6058 ,

    This is by design since calculated column is stored as sql_variant data type in Database, the sql_variant doesn’t support the like query, so the error occurs.

    Reproduced issue:

    113842-image.png

    113738-image.png

    As a workaround, we suggest you use FilterField/FilterValue parameters to find exact matches on single value per calculated column:

    http://sp13:xxxxx/Lists/list712/AllItems.aspx?FilterField1=Cal&FilterValue1=HelloWord  
    

    113806-image.png

    Similar issue for your reference:

    https://social.msdn.microsoft.com/Forums/office/en-US/5960e9ea-c8de-4bee-aa22-108faffab86f/does-list-view-query-string-filtermultivalue-parameter-not-work-for-calculated-columns?forum=sharepointdevelopment


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.