Looking for any workaround for below stated issue.
If I create a list with location column in the site and then try to fetch the columns of that list I get below response from GRAPH:
API used: https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/columns
...
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc",
"enforceUniqueValues": false,
"hidden": false,
"id": "0fbe07e6-28f7-4bed-ba05-c62cfaae9247",
"indexed": false,
"name": "item_x002d_loc",
"readOnly": false,
"required": false
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: Country/Region",
"enforceUniqueValues": false,
"hidden": false,
"id": "df94e72d-8ade-47bc-a4d8-260d6f58db6a",
"indexed": false,
"name": "CountryOrRegion",
"readOnly": true,
"required": false,
"text": {
"allowMultipleLines": false,
"appendChangesToExistingText": false,
"linesForEditing": 0,
"maxLength": 255
}
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: State",
"enforceUniqueValues": false,
"hidden": false,
"id": "25dd2636-0235-4de7-855f-7139667ca6ce",
"indexed": false,
"name": "State",
"readOnly": true,
"required": false,
"text": {
"allowMultipleLines": false,
"appendChangesToExistingText": false,
"linesForEditing": 0,
"maxLength": 255
}
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: City",
"enforceUniqueValues": false,
"hidden": false,
"id": "c1e02124-2a43-49dd-92ba-00ab2ada3fef",
"indexed": false,
"name": "City",
"readOnly": true,
"required": false,
"text": {
"allowMultipleLines": false,
"appendChangesToExistingText": false,
"linesForEditing": 0,
"maxLength": 255
}
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: Postal Code",
"enforceUniqueValues": false,
"hidden": false,
"id": "824de7f8-cf8a-4294-a8fa-bd08833f863b",
"indexed": false,
"name": "PostalCode",
"readOnly": true,
"required": false,
"text": {
"allowMultipleLines": false,
"appendChangesToExistingText": false,
"linesForEditing": 0,
"maxLength": 255
}
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: Street",
"enforceUniqueValues": false,
"hidden": false,
"id": "4f6e3b89-16c4-4578-a57a-203879b254cb",
"indexed": false,
"name": "Street",
"readOnly": true,
"required": false,
"text": {
"allowMultipleLines": false,
"appendChangesToExistingText": false,
"linesForEditing": 0,
"maxLength": 255
}
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: Coordinates",
"enforceUniqueValues": false,
"hidden": false,
"id": "6077b757-d00d-4af1-a583-0060a0c80ff9",
"indexed": false,
"name": "GeoLoc",
"readOnly": true,
"required": false,
"geolocation": {}
},
{
"columnGroup": "Custom Columns",
"description": "",
"displayName": "item-loc: Name",
"enforceUniqueValues": false,
"hidden": false,
"id": "35a31383-a431-4b46-9f2e-959cac690967",
"indexed": false,
"name": "DispName",
"readOnly": true,
"required": false,
"text": {
"allowMultipleLines": false,
"appendChangesToExistingText": false,
"linesForEditing": 0,
"maxLength": 255
}
},
...
From this response, it is not evident that column item-loc is of Location column type.
The other columns in the response are readonly columns that gets created when you create a Location column.
Also if we populate an item for above column, this is what the response we get from GRAPH:
API used: https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/items/{{itemid}}/fields
...
"item_x002d_loc": {
"address": {
"city": "Calgary",
"countryOrRegion": "Canada",
"postalCode": "T2E6W5",
"state": "Alberta",
"street": "2000 Airport Rd NE"
},
"coordinates": {
"latitude": 51.1333,
"longitude": -114.008
},
"displayName": "Calgary International Airport",
"locationUri": "https://www.bingapis.com/api/v6/localbusinesses/YN1226x8430288103509718371",
"uniqueId": "https://www.bingapis.com/api/v6/localbusinesses/YN1226x8430288103509718371"
},
"CountryOrRegion": "Canada",
"State": "Alberta",
"City": "Calgary",
"PostalCode": "T2E6W5",
"Street": "2000 Airport Rd NE",
"GeoLoc": {
"latitude": 51.1333,
"longitude": -114.008
},
"DispName": "Calgary International Airport",
...
The value for item-loc field is a nested map structure and there should be a column definition to accept this data.
It would be good to have implementation for column definition of location type, so that we can identify the location column type from response, create the column and populate values accordingly to it.
Similar issue for hyperlink column as well.
Issue details for hyperlink column: https://github.com/microsoftgraph/msgraph-sdk-go/issues/640