question

EskildDiderichsen-8236 avatar image
0 Votes"
EskildDiderichsen-8236 asked saldana-msft edited

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

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.



office-sharepoint-onlinesharepoint-devmicrosoft-graph-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

@EskildDiderichsen-8236,

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.