1

I Want to display lookup column values in single line of text. ProductName lookup column with multiple selection. I tried using JSON column formatting but values are not showing. Please can anyone help me on this?

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

enter image description here

list


Update:

Power automate flow:

enter image description here

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

1
  • Can you try opening list view in modern experience instead of classic experience? Nov 18, 2023 at 12:55

1 Answer 1

0

I just tried using the same JSON you provided in our SharePoint site and it worked for me without any issue:

enter image description here

Try/make sure below things:

  1. Open the SharePoint list view in modern experience instead of classic experience as JSON formatting only works with modern experience. You can change the list experience by following these steps:

    • Go to your SharePoint list
    • Click on Settings (gear) icon from top right corner and select List settings
    • Select Advanced settings from list settings page and scroll at the bottom of advanced settings page
    • Set List experience to New experience and click OK to save the changes:

    enter image description here

  2. Make sure you are using correct internal name of your lookup column in JSON. You can get the exact internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?

6
  • Thank you for quick response.
    – Lucky
    Nov 20, 2023 at 3:54
  • In my list many tasks are handled by JavaScript, content editor and script editor are used so the list always in the classic view. There is a requirement, user wants weekly backup of list records. I have created a scheduler flow to get the records and stored in csv but only two lookup column values are in the format of @odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference" in the excel. It will be easy if i get lookup values in single line of text. Can you please help me to fix.
    – Lucky
    Nov 20, 2023 at 3:56
  • Are you using flow to write data in CSV file or are you using SharePoint default export to excel/CSV feature? If you are using flow, you can use flow itself to fetch lookup information & adding it to CSV OR to update single line of text column in the list. Nov 20, 2023 at 5:16
  • I have created a schedular power automate flow to get list records and stored in CSV file. It will run every Saturdays. In my SharePoint list 6 lookup columns are there in that 2 lookup column values are in different format(@odata.type:#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference) rest lookup column values are proper. so I'm trying to get lookup values in a single line of text in the list itself.
    – Lucky
    Nov 20, 2023 at 11:43
  • Can you add a screenshot of your flows to your original question? You should be able to read the lookup column value directly inside the flow without needing to add new column in the list. Why 2 columns are in different format, did you add values to those columns using Power Apps or Power Automate? Nov 20, 2023 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.