Retrieve custom properties of Office files through API call in OneDrive

Vahe 16 Reputation points

In SharePoint, we are able to retrieve custom properties of the Office files through API call using Microsoft's CSOM library.
This information is usually available in the "Properties" field. However, when uploading the same file to OneDrive and doing the same request, "Properties" field does not contain this information.

As an example, please find the attached "Test DOCX file with custom properties.docx" file.

It contains 2 custom properties - "TestCustom1" and "TestCustom2". When uploading to SharePoint, this information is becoming available through API. SharePoint also changes the file size, so we assume it stores this data somewhere to make it available later for API requests.
When uploading to OneDrive the file size does not grow and custom properties are not available during the request.

So, our questions are

  1. Why it works for SharePoint and does not work for OneDrive?
  2. Is there a setting or some feature in OneDrive which will make it available there?

Thanks, Vahe.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,553 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.
2,654 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 30,751 Reputation points Microsoft Vendor

    Hi @Vahe
    Per my research, there is no such function to set custom properties to onedrive files. You can refer to the similar issue with yours

    Thanks for letting us know your user experience. According to your case description, I do understand how frustrated you are now.

    When I received the case, I searched a lot of documents did a lot of researches. And I feel regretful to inform you that it turns out to be a by-design one.

    And I noticed that some end users have also proposed the same request, it is highly recommended that you can vote this ticket. Many features of our current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.

    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.

    1 person found this answer helpful.