2

I am trying to insert an email address into a google sheet cell as a hyperlink, so that only the word "email" will appear instead of the whole email address, here an example of what I want to do a cell that contain a hyperlink which is actually an email address

Here is the last code I tried

import hyperlink
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint

scope = ["https://spreadsheets.google.com/feeds", 'https://www.googleapis.com/auth/spreadsheets',
         "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive"]

creds = ServiceAccountCredentials.from_json_keyfile_name("creds.json", scope)

client = gspread.authorize(creds)

sheet = client.open("influenceurs_35k-55k(08.07.20)").sheet1

data = sheet.get_all_records()

col = sheet.col_values(2)

insertRow = ["hello", 5, "red", "blue"]

sheet.delete_rows(14)

sheet.insert_row(insertRow, 14)

sheet.update_cell(14,1, "seyepapeseny@gmail.com".format("email"))

sheet.format("A14:b14")

"seyepapeseny@gmail.com" is the email I want to insert as hyperlink with gspread

griffin_cosgrove
  • 419
  • 8
  • 16
Seye
  • 111
  • 8

1 Answers1

8

I figured it out that it was possible to use google sheet formulas

sheet.update_acell('A14','=HYPERLINK("seyepapeseny@gmail.com","email")')
Seye
  • 111
  • 8