Update DriveItem properties & replace the contents of a driveItem

Akshith Reddy Thalla 100 Reputation points
2024-05-01T06:59:50.12+00:00

When I do the Update DriveItem properties (https://learn.microsoft.com/en-us/graph/api/driveitem-update?view=graph-rest-1.0&tabs=http), there is no increase in version in version history but when I do replace the contents of a driveItem (https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http), version got increased.

Just wanna know is it expected? Can't the version remains the same even if I update the contents of a driveItem.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,797 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,825 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 32,081 Reputation points Microsoft Vendor
    2024-05-01T09:46:57.4+00:00

    Hi @Akshith Reddy Thalla,

    This is an expected behavior. Since the version history is to restore a previous version of a file in onedrive. This behavior won't record the update of item properties. It only record each version of the file content changes.

    Currently we are unable to disable the version history to stop increase of the version. We can only set minimum file versioning to 100. Please refer to the following article

    https://sardhianto.medium.com/microsoft-onedrive-file-versioning-setting-4aa7567c48ba


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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