JSON lookup column

christieA-9828 100 Reputation points
2024-11-20T16:06:45.3366667+00:00

Does JSON support lookup column?

I use [$lookupcolumn] to set a column value in JSON, but it is not working. What could be the issue?

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,105 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 18,935 Reputation points Microsoft Vendor
    2024-11-21T02:12:34.7333333+00:00

    Hi @christieA-9828,

    Thank you for posting in this column.

    The Lookup column supports column formatting. However, SharePoint JSON column formatting primarily customizes how fields are displayed rather than setting their values.

    User's image

    User's image

    Reference: Use column formatting to customize SharePoint.

    For lookup columns, JSON formatting can display the lookup value using the lookupValue property, but it doesn't change the underlying data.

    Here's an example of how you can format a lookup column to display its value:

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "@currentField.lookupValue"
    }
    

    This JSON snippet will display the lookup value in the column. However, if you need to set or update the value of a lookup column, you'll need to use other methods like Power Automate, Power Apps etc.


    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 additional answers

Sort by: Most helpful

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.