Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Handling of Hyperlink and Location columns #5166

Open
HiteshRepo opened this issue Jan 30, 2024 · 0 comments
Open

Handling of Hyperlink and Location columns #5166

HiteshRepo opened this issue Jan 30, 2024 · 0 comments
Labels
lists category of sharepoint service sharepoint

Comments

@HiteshRepo
Copy link
Contributor

Here is an example of graph API response of columns of a list:

[
  {
    "columnGroup": "Custom Columns",
    "description": "",
    "displayName": "ISBN",
    "enforceUniqueValues": false,
    "hidden": false,
    "id": "fa564e0f-0c70-4ab9-b863-0177e6ddd247",
    "indexed": false,
    "name": "Title",
    "readOnly": false,
    "required": false,
    "text": {
      "allowMultipleLines": false,
      "appendChangesToExistingText": false,
      "linesForEditing": 0,
      "maxLength": 255
    }
  }
]

This column is recognizable to be a text column from the response.

Some columns in sharepoint list aren't recognizable from the GRAPH API response.

Hyperlink column:

Column response

[
  {
    "columnGroup": "Custom Columns",
    "description": "",
    "displayName": "Hyp-Col",
    "enforceUniqueValues": false,
    "hidden": false,
    "id": "1b30f675-1316-498c-a5f1-901bca2d5470",
    "indexed": false,
    "name": "Hyp_x002d_Col",
    "readOnly": false,
    "required": false
  }
]

Fields response

{
  "Title": "item-1",
  "Hyp_x002d_Col": {
    "Description": "item-1-url",
    "Url": "https://example.com/item-1"
  }
}

Location Column:

Column response

[
  {
    "columnGroup": "Custom Columns",
    "description": "",
    "displayName": "Loc-Col",
    "enforceUniqueValues": false,
    "hidden": false,
    "id": "85df986d-e844-4bd5-bcf1-dd62d4c39a39",
    "indexed": false,
    "name": "Loc_x002d_Col",
    "readOnly": false,
    "required": false
  }
]

Fields response

{
    "Title": "item-1",
    "Loc_x002d_Col": {
        "address": {
            "city": "Kolkata",
            "countryOrRegion": "India",
            "postalCode": "700012",
            "state": "West Bengal",
            "street": "265, Bepin Behari Ganguly Street, 1st Floor"
        },
        "coordinates": {
            "latitude": 22.571,
            "longitude": 88.3568
        },
        "displayName": "Calcutta Photo Tours",
        "locationUri": "https://www.bingapis.com/api/v6/localbusinesses/YN4070x16441674068003643871",
        "uniqueId": "https://www.bingapis.com/api/v6/localbusinesses/YN4070x16441674068003643871"
    },
    "CountryOrRegion": "India",
    "State": "West Bengal",
    "City": "Kolkata",
    "PostalCode": "700012",
    "Street": "265, Bepin Behari Ganguly Street, 1st Floor",
    "GeoLoc": {
        "latitude": 22.571,
        "longitude": 88.3568
    },
}

Therefore while restore of these columns, we default them to as text fields.
The value they hold are therefore not reinstated to the way the originally were.

This is a known issue and the resolution depends on graph API support for these columns.

@HiteshRepo HiteshRepo added sharepoint lists category of sharepoint service labels Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lists category of sharepoint service sharepoint
Projects
None yet
Development

No branches or pull requests

1 participant