Published on April 20, 2017 by Google

In this conclusion of our two-part series on field masks, engineer Wesley Chun shows viewers how to use field masks with update API requests. In the previous episode, you learned that when reading data from an API, field masks can be used as a “partial response” mechanism to control the amount of data that comes back in the response payload. For update requests, field masks have a different responsibility: to tell the API exactly which fields should be set (and perhaps which should be reset). We’ll conclude with tips to remember when using field masks for either API request type, including a double example where field masks not only designate values to update but also control the data returned in the API response. Also featured are JavaScript & Python code snippets for using field masks with the Google Sheets & Slides APIs.

Related links for this episode:
Blog post –
Updating spreadsheets field masks guide –
Field masks and Protocol Buffers documentation page –
Slides API field mask guide (READ+WRITE) –
“Setting up new Google API projects” DevByte video –
Google Developers Console –
Google APIs Client Libraries –
“Common Python code walkthrough” DevByte video –
G Suite Dev Show video series playlist –
Launchpad Online developer video series –
Google Developers YouTube channel –

Leave a Reply

3 Comments on "Using field masks with update requests to Google APIs"

Notify of

Scott Walsh
Scott Walsh
9 days 6 hours ago

Screw fields, we damand THE PHYSICAL WEB/ NEARBY be working yesterday. At least by Monday!!!!!! Now, go ahead and ramble on about fields. That's enough, Im outta here. Anybody got one of those Safarai laptop things?

9 days 20 hours ago

Speedy recovery Wesley~!

Geeky Artists
Geeky Artists
10 days 5 hours ago

Help me I can't make a spreadsheet in my Google Drive using Drive APi!