0

I need to show the description of column as a tooltip when a user hover a mouse on a column, I am doing this based on Adding custom hover text using json to a SharePoint list column

But I need to enter the description manually rather than reading the description of the column that I put earlier for that column in the Description textbox.

see below:

enter image description here

enter image description here

enter image description here

If I change "txtContent": "[$Description]", to "txtContent": "This is the desciption", it works fine, is there any way to fix the previous issue and get the description rather than entering a new description here as txt enter image description here

2
  • 1
    Please note that [$Decription] in the example is a separate column, and hovering on the [Title] column values is showing values from the [$Description] column. As I understood your requirements, you need to show the Description, which is meta data, of column [Name]. There's a way to show column's meta data. However, my testing didn't work for "Description", but worked for "DisplayName", that is, [!Project.DisplayName] worked but [!Project.Description] did not worked. Here [Project] is a custom column, and you can refer meta data in JSON using a ! char Nov 28, 2020 at 19:32
  • Thank you, I realized the Prj.Description vs meta description in the middle of trying the approach you suggested in the previous answered example. So, I was trying to get the meta data description as you highlighted and also shown by the above screenshots to avoid any confusion Nov 28, 2020 at 22:00

2 Answers 2

0

Based on MS JSON reference guide at here, we should be able to show meta data in column formatting.

[!FieldName]

In column and view formatting, you can refer to any field's metadata by specifying the internal name of the field surrounded by square brackets and preceded by a exclamation mark: [!InternalName]. Currently field's display name is available in this metadata, and can be accessed using DisplayName property: [!SalesLead.DisplayName].

However, it didn't work for me for the Description. My testing worked for [!Project.DisplayName], but didn't work for [!Project.Description] (here, Project is a custom column).

2
  • thx a lot, based on your description, So, I guess I have to manually type the description in two different places: JSON formatting and the "Description" of the column Nov 28, 2020 at 22:03
  • I also checked the src code for both view and when we are editing the column properties to see whether I can see the internal name of Description, no success, when in editing mode, I was able to see a derived version of description but "txtContent": "[!Project_x0020_Name.__description__]" did not work too – Nov 28, 2020 at 23:57
1

As far as I know, there's no way to get the column description in JSON column formatting. You have to manually type the description in the json code.

1
  • thx Michael, upvoted, thx for confirming Nov 30, 2020 at 18:21

Your Answer

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

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