Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

211
Views
google docs api documents.get multiple fields ? (nodejs)

How can I select multiple fields when using the documents.get ?

Right now I am getting the documenmt like this:

  const doc = await docs.documents.get({
    documentId: copiedFile.data.id,
    fields: 'body/content'
  });

which returns this:

"data": {
  "body": {
    "content": [...]
  }
}

However, I need to also get the inlineObject and the only way so far I have been able to do so, is by removing the fields proeprty completely

  const doc = await docs.documents.get({
    documentId: copiedFile.data.id,
  });

Then I get this:

"data": {
  "title": "Some document title",
  "body": {
    "content": [...]
  },
  "headers": {
  },
  "footers": {
  },
  "documentStyle": {
  },
  "namedStyles": {
  },
  "lists": {
  },
  "revisionId": "some-long-id",
  "suggestionsViewMode": "SUGGESTIONS_INLINE",
  "inlineObjects": {
  },
  "documentId": "some-long-id"
}

But I am really only interested in data.body.content and data.inlineObjects When selecting everything the response is many thousands of lines of json larger, which I don't want.

I have tried fields: ['body/content', 'inlineObjects'] but that only returns body.content and not the inlineObjects - also the documentation doesn't mention this syntax anywhere, it was just to experiment.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think it doesn't return any inlineObjects when you don't have any inlineObjects in the document. To confirm if the actual format is working and the statement above is true, try using other fields where a value is confirmed to be returned such as revisionId or title.

Test:

const doc = await docs.documents.get({
  documentId: copiedFile.data.id,
  fields: 'body/content,inlineObjects'
});

Output:

output

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!