1

Is this is real or i just didn't find it in documentation? And how i can fill only column with checkboxes?

3

I found it. It's look like that:

service.spreadsheets().batchUpdate(spreadsheetId=spreadsheet_id, body={
    'requests':
        [
            {
                'repeatCell':
                    {
                        'cell': {'dataValidation': {'condition': {'type': 'BOOLEAN'}}},
                        'range': {'sheetId': 0, 'startRowIndex': 1, 'endRowIndex': added_branches + 1,
                                  'startColumnIndex': 4,
                                  'endColumnIndex': 5},
                        'fields': 'dataValidation'
                    }
            },
            {

            },
        ]
}).execute()

enter image description here

1

Eugene, you can do this without a script.

See this article in the Google Sheets documentation.

Good luck.

Addendum 10/20/18:

Here is the text of that Google Link:

Insert checkboxes

  1. On your computer, open a spreadsheet in Google Sheets.
  2. Select the cells you want to have checkboxes.
  3. In the menu at the top, click Insert > Checkbox.
  4. To remove checkboxes, select the checkboxes you want to remove and press Delete.

Note: You can use checkboxes with charts, filters, pivot tables, and functions.


Add custom checkbox values

You can add checkboxes with custom values. For example, the custom checked value could be "Yes," and the unchecked value could be "No."

  1. On your computer, open a spreadsheet in Google Sheets.
  2. Select the cells you want to have checkboxes.
  3. In the menu at the top, click Data > Data validation.
  4. Next to "Criteria," choose Checkbox.
  5. Click Use custom cell values.
  6. Next to "Checked," enter a value.
  7. Optional: Next to "Unchecked," enter a value.
  8. Click Save.
  • 1
    Hi Erik, could you summarize what's at the article in the body of the post, please? While it is a Google support document, links still occasionally go stale and the information would be lost otherwise. Thanks! – jonsca Oct 20 '18 at 0:20
  • jonsca, I have brought over and formatted the information from that link. If you were the person who down-voted me over sharing information in a way that wasn't your preference, now that I have edited the post, please consider upvoting. And if not ... c'est la vie. – Erik Tyler Oct 21 '18 at 4:34
  • 1
    Thanks for taking the time to edit the post! I was not the original downvoter. – jonsca Oct 21 '18 at 21:55
  • I didn't downvoted, but the reason can be, that OP explicitly mentioned "using google sheets api v4". Maybe he knows what you said, but wanted to make programmatically. However, your answer is helpful for beginner. – vesszabo May 16 at 18:37

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.