I have a Google Sheet that contains rows with column headers. It’s super easy to use this API, by the way, thank you for that. Two columns contain a formula like =IMAGE("url.com/image.jpg")
. Accessing those cells returns an empty string. The documentation suggests print(ws[1, 2].input_value)
returns the original formula, but I’m accessing cells by column headers, so I never have a cell object to call input_value on.
I think there are two ways of handling this: either there’s some hidden method that returns the cell address and I then call input_value, or there’s another way of accessing the cell value that doesn’t return an empty string.
How do I access the URL contained in a formula? Thanks folks!
My abbreviated code:
def build_database():
sheet = app_files.data_spreadsheet
worksheets = []
worksheets.append(sheet["Tops"])
worksheets.append(sheet["Headwear"])
worksheets.append(sheet["Accessories"])
for worksheet in worksheets:
for row in worksheet.rows:
app_tables.gifts.add_row(
name=row["name"],
color1=row["color1"],
color2=row["color2"],
style=row["style"],
closet_image=row["closetimage"][8:-2])