Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16595

Add dropdown menu (nested list) to Google Spreadsheat with gspread / Google Spread API to whole column

$
0
0

I am struggling to insert a dropdown menu into a Google Spreadsheet using the gspread module in python.

This question explains how to get a dropdown menu in a spreadsheet:

How to add a nested list with gspread?

However, even if I change the startColumnIndex and endColumnIndex the dropdown menu only shows up in one cell.

I have experimented with something like this:

data = sheet.get_all_values()values = [request if e[3] != "" else "" for e in data]cells = sheet.range("C1:C%d" % len(values))for i, e in enumerate(cells):    e.value = values[i]sheet.update_cells(cells)

where request is the dropdown menu. So I want to insert a dropdown menu in the fourth column if the third column is not empty, else I don't want to insert anything.But as of now, this only works if request is a regular string and not the dropdown formatted cell I want it to be.

This picture shows what I want. You can see that row 1, 3, and 4 have a dropdown list in the fourth column (as the third column is not empy) while row 2 doesn't have anything.

It seems to be that it would be batch to use the batch_update module in combination with request and not the loop but I don't seem to get it working for multiple cells at the same time (preferably a whole column).

Thank you for your help!


Viewing all articles
Browse latest Browse all 16595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>