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.
Thanks for your contribution! Sharing is caring.
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
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: