Copying a DriveItem on SharePoint using PostAsync doesn't work on unique fields

Eskild Diderichsen 21 Reputation points
2021-08-04T10:06:40.797+00:00

I've raised this issue in other places, and it lead me here

The issue is simple.
I want to be able to copy a DriveItem with a unique field to the same folder.

This is currently not possible as the graph API doesn't allow changing the unique field via the copy API.

I'd like the API to support that.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,241 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,803 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,031 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,036 Reputation points
    2021-08-05T07:50:47.927+00:00

    @Eskild Diderichsen ,

    The copy a DriveItem in Graph API will also copy the cutom field value. So when you copy within the same folder, it would also duplicate the field for this file and this violate unqiue field rules.

    Currenty, you could try to download the file to local, then upload it to the folder.

    For the feature request,here is the right place to submit the feedback : https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.