Using Google Sheet with Dropdown

What I’m trying to do:
The items contained in a dropdown need to feed in from a Google Sheet. I have that working, no issues there.

My problem is that instead of the text strings from my Google Sheet, for example: “Yes”, “No”, “Maybe”,
I’m getting “”, " ", “”. What is the best way to remove “” and just leave the raw text string, i.e. “Yes”, “No”, “Maybe”?

What I’ve tried and what’s not working:

Code Sample:

  
  def drop_down_1_show(self, **event_args):
    """This method is called when the DropDown is shown on the screen"""
    wb = app_files.database #Declare the workbook
    ws2 = wb['Allowed Responses'] #Declare the worksheet
    responses = (ws2.list_cells(min_row=1, max_col=1, max_row=len(ws2.rows), min_col=1))
    self.drop_down_1.items = [str(i) for i in responses]
    pass
  

Clone link:
share a copy of your app

Have you tried i.text instead of str(i)?

I don’t know Google APIs, I’m just guessing there is something like cell.text or cell.value.

3 Likes

Thanks @stefano.menci!

“str(i.value)” worked.

1 Like