3

How to get ContentDocument file body blob in APEX. We can query ContentVersion but it give result like enter image description here

It gives some URL but I need blob of body. How can we get them.

6
  • 1
    In query editor, you will get this. But if you do it in apex , you will actually get the blob data.Try the same query in execute anonymous
    – Preya
    Mar 28, 2018 at 13:23
  • Do same query in Execute Anon and print it, you will get blob response. Mar 28, 2018 at 13:24
  • @Preya you can add that as answer.
    – SF User
    Mar 28, 2018 at 13:27
  • Could you tell me what query was used here? Which field in ContentVersion actually has the contents of the body of a note?
    – cethegeek
    May 10, 2018 at 13:41
  • In other words: Is versionData the field that contains the body?
    – cethegeek
    May 10, 2018 at 13:48

1 Answer 1

7

In query editor, you will get this. But if you do it in apex , you will actually get the blob data.Try the same query in execute anonymous

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.