I want to create a view using JSON formatting. In this view I want to use a location column called "Adres" (I checked the URL and the field name really is called "Adres").

The formatting works fine with all the other columns, except when I try to add the value from the location column. In the formatting I type [$Adres], similar to the other columns, but the whole view disappears. As long as I don't use location columns the formatting works fine.

Do I have to refer to the value of a location column in a certain way other than [$Adres]?

Thanks for your help.

  • What is the data type of your column? Location? – Ganesh Sanap Jul 13 '20 at 5:21
  • Hi Ganesh, the column is indeed a location type colum. With all the other types of column everything works fine. – Bart Vandamme Jul 13 '20 at 12:12
  • Can you please add a JSON code you are using to your question? it will be helpful to answer your question. – Ganesh Sanap Jul 13 '20 at 12:30

In order to use Location fields you need to use one of the properties it exposes in JSON formatting.

The location field object has the following properties (with example values):

   "Address": {
      "City": "Knoxville",
      "CountryOrRegion": "United States",
      "State": "TN",
      "Street": "963 Worlds Fair Park Dr"
   "Coordinates": {
      "Latitude": "35.961673736572266",
      "Longitude": "-83.92420959472656"
   "DisplayName": "World's Fair Park",
   "LocationUri": "https://www.bingapis.com/api/v6/localentities/8346bf26-6da4-104c-6ba5-2334b83f6ac8?setLang=en"

For Example, if you want to get the name of City then you need to use [$InternalName.Address.City] OR if you want to get the name of country or region then you will use [$InternalName.Address.CountryOrRegion].

So, make sure you are using this column in proper supported format/syntax.

Reference: Use column formatting to customize SharePoint - Special String Values

  • 1
    Thank you Ganesh. Problem solved! I used [$Adres.Address.Street] instead of [$Adres] – Bart Vandamme Jul 14 '20 at 10:08
  • Great, glad it helped you. – Ganesh Sanap Jul 14 '20 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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