Sharepoint JSON - how to filter a lookup column in another list, by multiple values?

Christopher Duncan 0 Reputation points
2023-04-25T22:24:17.79+00:00

How to change this sharepoint json code such that the formatted column with hyperlink directs to a list (with a lookup column) that is filtered by both values of [$MOCx_0023_] and empty values at the same time?

{"$schema":     "https://developer.microsoft.com/jsonschemas/sp/v2/column-formatting.schema.json",   
"elmType": "a",   
"attributes":  {     
"iconName": "OpenFolderHorizontal",     
"class": "ms-fontColor-themeDark",     
"href": "='https://ABC.sharepoint.com/sites/ABC/MOC%20files/Forms/AllItems.aspx?FilterField1=MOC_x0023__x0028_lookup_x0029_&FilterValue1=' + [$MOC_x0023_]",     
"target": "_blank"   
 },   
"style": {     
"font-size": "18px",     
"text-decoration": "none",     
"padding-left": "15px",     
"font-weight": "bold"   } 
}
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,053 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 43,181 Reputation points Microsoft Vendor
    2023-05-05T06:28:07.2566667+00:00

    In the JSON formatting you provided, "https://ABC.sharepoint.com/sites/ABC/MOC%

    20files/Forms/AllItems.aspx?FilterField1=MOC_x0023__x0028_lookup_x0029_&Filter

    Value1=' + [$MOC_x0023_]" is a dynamic URL to filter the view in list A.

    For the hyperlink column of list B, JSON formatting only can set a static URL as its value.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.

    0 comments No comments