Multiple sequential Batch requests

Lars Schweikardt 1 Reputation point
2022-04-13T10:56:09.543+00:00

Hi all,

Iam currently writing an application to write Sharepoint lists. Iam using sequential batch requests so every request depends on the one before (serial). This works fine when writing one list at a time, in case of i.e. writing 20 individual lists in parallel (parallel on our side) Iam facing random errors such as:

  • "The specified column was not found" during item creation.
  • "The specified column already exists" during column creation. I.e. it fails on creating "StringCol" column but when having a look at the list in the SharePoint UI there is no such column.

We are implementing an overwriting behavior for a list and therefore:

  1. Delete all columns which we are allowed to delete
  2. Create the new columns
  3. Delete the remaining items (Title because you cant delete the title column)
  4. Creating the list items

I implemented it in such a way because there seems no other way do "clear" a list more easily and it works perfectly fine when doing that to one list at a time but the problems occur when trying to do this on multiple lists.

Iam assuming that on Sharepoint Side there is a race condition or something like that.

Would be nice to hear what I could against this behavior.

Best regards
Lars

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,482 questions
{count} votes