Sample payload:
{
"text": {
"maxLength": 1000
}
}
And my PATCH Url is https://graph.microsoft.com/v1.0/sites/my-site-id/lists/my-list-id/columns/my-column-id
I am providing the usual headers Accept: application/json Content-Type: application/json And Authorization: Bearer Token....
I get BadRequest error
{
"error": {
"code": "invalidRequest",
"message": "One of the provided arguments is not acceptable.",
"innerError": {
"code": "badArgument",
"date": "2023-01-30T16:34:49",
"request-id": "b63137f9-fda0-41b7-9549-5952b5c89427",
"client-request-id": "b63137f9-fda0-41b7-9549-5952b5c89427"
}
}
}
I tried adding "propagateChanges": true to the payload and I get slightly different error
{
"error": {
"code": "invalidRequest",
"message": "Invalid request",
"innerError": {
"date": "2023-01-30T16:39:37",
"request-id": "41ca6541-6097-45c6-9418-d1cf57272d2c",
"client-request-id": "41ca6541-6097-45c6-9418-d1cf57272d2c"
}
}
}
Any help is appreciated.
NOTE: I am able to update for e.g. Description of the column, but not the text.maxLength property.
The maximum length of a SharePoint text field type is 255, you cannot set it to 1000. If you try setting the max length to 200 for example instead of 1000, your query should succeed.
To allow longer strings, you have to use the "note" ("multiline text") field type, not "text". This one has a limit of 63,999.
I am not sure if you can change column type using graph api (you cannot as far as I remember, but I am not 100% sure), you may need to re-create that column as "multiline", change manually, use the classic rest api instead of graph api to do it programmatically, or something like a powershell script.