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)

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint For business Windows
Microsoft 365 and Office SharePoint Server Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JoyZ 18,111 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.