How to apply the lookup value when formatting the column by JSON

Li, York 61 Reputation points
2023-05-05T09:44:56.41+00:00

Hi Guys:

  I have a list with lookup value, the lookup source is product name, the lookup value is the column "Product Name:Mic Assembly", and if the Inspection Type is "Mic Assembly", I hope the Workstaion Qty will be "9" as shown in the "Product Name:Mic Assembly" column. 

  But the expression below can't get the value, could you help check the reason? "[$ProductName:MicAssembly.lookupValue]" may be a mistake, but I don't know how to correct it.

User's image

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,737 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 41,946 Reputation points Microsoft Vendor
    2023-05-08T08:00:07.1366667+00:00

    Please use following formula in the JSON formatting.

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "=if([$InspectionType] == 'Mic Assembly', '[$Product_x0020_Name_x003a__x0020_]', 'NO')"
    }
    

    Result:

    User's image


    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful