Sp-dev-docs: Set column value from a Lookup field using JSON

Created on 13 Feb 2019  Â·  5Comments  Â·  Source: SharePoint/sp-dev-docs

I've tried assigning a value to a text column based on the choice of a lookup field. I've tried a few solutions but the closest I can get is having [Object Object] returned instead of the actual value.

What is the JSON code to return the text values of a Lookup column. The Lookup Column referenced is located on the same site.

Category

  • [] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

jsonchoiceassign

Thanks for your contribution! Sharing is caring.

Author Feedback list-formatting question

Most helpful comment

@PopWarner you're correct. In this case, the issue was with putting the sub property outside of the brackets. @ChadMagee and I were able to work on this together after my session at SPTechCon.

For everyone stumbling here from search, the solution was to use:

"txtContent": "[$Sand_x0020_Type.lookupValue]"

All 5 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Hi ChadMagee

The guidance in the docs for column formatting shows using ‘.lookupValue’ on the field. Does that work for you? :)

You had mentioned you tried a few solutions, so wasn’t sure if this was one of them.

You can see the guidance and an example here near the bottom of the page:
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting

@PopWarner you're correct. In this case, the issue was with putting the sub property outside of the brackets. @ChadMagee and I were able to work on this together after my session at SPTechCon.

For everyone stumbling here from search, the solution was to use:

"txtContent": "[$Sand_x0020_Type.lookupValue]"

Awesome!! :)

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonthenerd picture jonthenerd  Â·  3Comments

jonthenerd picture jonthenerd  Â·  3Comments

StfBauer picture StfBauer  Â·  3Comments

ken-harris picture ken-harris  Â·  3Comments

mikeparkie picture mikeparkie  Â·  3Comments