0

We are working with SOQL to interact with Salesforce. Consider the very simple query:

      select Id, Content, TextPreview, Field
      from ContentNote
      limit 100

Per their documentation ContentNote. Content should be the rich text -- but what w are getting back a URL pointing to the content. Which requires us to do n+1 queries.

The response we get looks something like:

{
  attributes: {
    type: 'ContentNote',
    url: '/services/data/v42.0/sobjects/ContentNote/asdfasdf0707234sdsdf'
  },
  Id: '0692L000008xwLMQAY',
  Content: '/services/data/v42.0/sobjects/ContentNote/asdfasdf0707234sdsdf/Content',
  TextPreview: 'please give jonathan a call'
}

Note we are leveraging jsforce for our API access.

Has anyone worked around this?

FYI

enter image description here

Jonathan
  • 16,077
  • 12
  • 67
  • 106
  • I'm going to flag it as possible duplicate. Check if my answer https://stackoverflow.com/a/60284736/313628 helps you. `ContentNote` is technically stored as `ContentDocument`/`ContentVersion` with special type so probably you're hitting same thing. "Deal with it" (extra API call per document) or see if you can switch over to SOAP API and decode base64 payload. No idea if jsforce can be easily switched over to SOAP though. – eyescream Oct 28 '21 at 20:23
  • Does this answer your question? [Get base64 data of file from Salesforce](https://stackoverflow.com/questions/60283198/get-base64-data-of-file-from-salesforce) – eyescream Oct 28 '21 at 20:23

0 Answers0