JSON lookup column

christieA-9828 140 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?

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. Ling Zhou_MSFT 23,665 Reputation points Microsoft External Staff
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.