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

Change in GRAPH API response for certain columns #5084

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

Change in GRAPH API response for certain columns #5084

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

Comments

@HiteshRepo
Copy link
Contributor

GRAPH Version: v1.0

Any change log: No. https://developer.microsoft.com/en-us/graph/changelog/?filterBy=v1.0,Change,Sites%20and%20lists

What changed:

Metadata column:

image

API response for the columns (https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/columns)

{
  "columnGroup": "Custom Columns",
  "description": "",
  "displayName": "metadata",
  "enforceUniqueValues": false,
  "hidden": false,
  "id": "b7d8597e-264e-4685-a2c4-6494147e9e72",
  "indexed": false,
  "name": "metadata",
  "readOnly": false,
  "required": false,
  "defaultValue": {
    "value": ""
  }
}
  • what changed in the column response for metadata column? --> No indication that is an metadata column.
  • is there a copy available for older response: No
  • what the column response used to look like: as far as I remember, it used to be:
{
  "columnGroup": "Custom Columns",
  "description": "",
  "displayName": "metadata",
  "enforceUniqueValues": false,
  "hidden": false,
  "id": "b7d8597e-264e-4685-a2c4-6494147e9e72",
  "indexed": false,
  "name": "metadata",
  "readOnly": false,
  "required": false,
  "term": {
    "value": ""
  }
}

API response for item data: https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/items/{{itemid}}/fields

{
  ...
  "Title": "item-1",
  "metadata": {
    "Label": "Engineering",
    "TermGuid": "6b5d3ce9-3043-499f-8be6-e92fb57bed96",
    "WssId": 4
  },
  ....
}
  • what changed in the item data response for metadata column? as far as I remember, it used to be:
{
  ...
  "Title": "item-1",
  "metadata": "Engineering",
  ....
}
  • is there a copy available for older response: No

Lookup column:
image

API response for the columns (https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/columns)

{
  "columnGroup": "Custom Columns",
  "description": "",
  "displayName": "lookup",
  "enforceUniqueValues": false,
  "hidden": false,
  "id": "18c1c815-56b6-4b8b-820a-e222095070e4",
  "indexed": false,
  "name": "lookup",
  "readOnly": false,
  "required": false,
  "lookup": {
    "allowMultipleValues": false,
    "allowUnlimitedLength": false,
    "columnName": "Title",
    "listId": "dab0d5a8-f9f9-4fab-a5d4-30b8300b3b11"
  }
}
  • what changed in the column response for lookup column? --> No change here.

API response for item data: https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/items/{{itemid}}/fields

{
  ...
  "Title": "item-1",
  "lookupLookupId": "1"
  ...
}
  • what changed in the item data response for lookup column? It used to be:
{
  ...
  "Title": "item-1",
  "lookup": "1"
  ...
}
  • is there a copy available for older response: No

Person column:
image

API response for the columns (https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/columns)

{
  "columnGroup": "Custom Columns",
  "description": "",
  "displayName": "person",
  "enforceUniqueValues": false,
  "hidden": false,
  "id": "9b633bd5-4d26-4178-b494-9320a34eaa91",
  "indexed": false,
  "name": "person",
  "readOnly": false,
  "required": false,
  "personOrGroup": {
    "allowMultipleSelection": false,
    "displayAs": "nameWithPresence",
    "chooseFromType": "peopleOnly"
  }
}
  • what changed in the column response for person column? --> No change here.

API response for item data: https://graph.microsoft.com/v1.0/sites/{{siteid}}/lists/{{listid}}/items/{{itemid}}/fields

{
  ...
  "Title": "item-1",
  "personLookupId": "10",
  ...
}
  • what changed in the item data response for person column? It used to be:
{
  ...
  "Title": "item-1",
  "person": "10"
  ...
}
  • is there a copy available for older response: No
@HiteshRepo HiteshRepo added sharepoint lists category of sharepoint service labels Jan 22, 2024
@HiteshRepo HiteshRepo self-assigned this Jan 22, 2024
HiteshRepo added a commit that referenced this issue Jan 24, 2024
Adds flag to manage lists restore enablement.
By passing `--allow-lists-restore` flag from sanity tests, we can test
sharepoint list restores.
By default the flag is `false`, hence restore operation will not run
unless the flag is provided.
Also the flag is hidden in CLI.

**Why add this flag?**
This [PR](#5048) enables Backup,
Restore and Export for sharepoint lists.
But some issues have emerged while restore because API response changes:
#5084.
So untill PRs for these issue have been merged, we should block restore
operation.
But allow sanity tests to be able to perform restore operation at the
same time.

#### Does this PR need a docs update or release note?

- [ ] ✅ Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x] ⛔ No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [x] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)
#4754 

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x] ⚡ Unit test
- [x] 💚 E2E
aviator-app bot pushed a commit that referenced this issue Jan 30, 2024
handles multiple persons list items.

**Original `person` list with single value**:
![Person-List](https://github.com/alcionai/corso/assets/48874082/a4a87cde-f907-4fc7-94da-f9ddda0f5a18)
 
**Restored `person` list with single value**:
![Restored-Person-List](https://github.com/alcionai/corso/assets/48874082/6b5c2a8b-743c-4020-9393-356d28948bf0)

**Original `person` list with multi value**:
![Person-List-Multi](https://github.com/alcionai/corso/assets/48874082/18d2c536-67ac-4b28-87be-2352764f2c95)

**Restored `person` list with multi value**:
![Restored-Person-List-Multi](https://github.com/alcionai/corso/assets/48874082/f9694e0d-d2cc-48d9-94f2-16b61c5b7cdb)

#### Does this PR need a docs update or release note?

- [ ] ✅ Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x] ⛔ No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)
#5108 
#5084 

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x] ⚡ Unit test
- [x] 💚 E2E
aviator-app bot pushed a commit that referenced this issue Jan 30, 2024
handles multiple lookup field values.

**Original `Lookup` list with single value**:
![Lookup-List-Single](https://github.com/alcionai/corso/assets/48874082/6a6b68cf-8fb9-4dfb-985e-702c4d74d3f0)

**Restored `Lookup` list with single value**:
![Restored-Lookup-List](https://github.com/alcionai/corso/assets/48874082/f97ac974-6a3b-4dd2-82c5-9f3596f9adaa)

**Original `Lookup` list with multiple values**:
![Lookup-List-Multi](https://github.com/alcionai/corso/assets/48874082/5f8b1b92-297f-4a66-b0b6-b5007d430690)

**Restored `Lookup` list with multiple values**:
![Restored-Lookup-List-Multi](https://github.com/alcionai/corso/assets/48874082/6c6d79ca-775d-4f50-abee-8090a28f3871)


#### Does this PR need a docs update or release note?

- [ ] ✅ Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x] ⛔ No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)
#5108 
#5084 

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x] ⚡ Unit test
- [x] 💚 E2E
aviator-app bot pushed a commit that referenced this issue Jan 30, 2024
handles single & multiple values for metadata columns

Similar to `Hyperlink` and `Column` columns, `Metadata` column too is unrecognizable from GRAPH API response. Hence identifying from the field column names.

`Metadata` fields are like tags. A `Metadata` fields can be configured to hold multiple values/tags

**Original List with `Metadata` column (Department) with single value/tag**:
![Metadata-List](https://github.com/alcionai/corso/assets/48874082/0b913a2a-46d5-4d9c-83f9-69a5236b1024)

**Restored List with `Metadata` column with single value/tag**:
![Restored-Metadata-List](https://github.com/alcionai/corso/assets/48874082/9420012b-345c-4fac-90c3-c0d421b2edfb)

**Original List with `Metadata` column (Department) with multiple value/tag**:
![Metadata-List-Multi](https://github.com/alcionai/corso/assets/48874082/054ef4a1-c46e-48ba-b410-a95b540cde33)

**Restored List with `Metadata` column with multiple value/tag**:
![Restored-Multi-Metadata-List](https://github.com/alcionai/corso/assets/48874082/ef6c904b-e431-4a85-9ef2-f08bcf8e21e4)


#### Does this PR need a docs update or release note?

- [ ] ✅ Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x] ⛔ No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)
#5084 
#5108 

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x] ⚡ Unit test
- [x] 💚 E2E
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