Given a specific cell from one Google Sheet that contains a hyperlink to another cell in another Google Sheet - how to get this link properly and how to get the value of the linked cell?
So far I've got this:
table_entities = gc.values().get(spreadsheetId=excel_id, range='XYZ').execute()['values']
table_entities_synthesis = gc.get(spreadsheetId=excel_id, ranges='XYZ', fields="sheets/data/rowData/values/hyperlink").execute()
synthesis_rangeid_list = []
for hyperlink in table_entities_synthesis.get('sheets')[0].get('data')[0].get('rowData'):
if hyperlink.get('values', ''):
hyperlink = hyperlink.get('values')[1].get('hyperlink')
synthesis_rangeid_list.append(hyperlink)
request = gc.spreadsheets().values().get(spreadsheetId=ABC, range=hyperlink,
valueRenderOption=value_render_option, dateTimeRenderOption=date_time_render_option)
response = request.execute()
But this approach gives me a list of range ids like this one: '#rangeid=737563017' and I have no idea how to access the data from that other sheet with this (for sure it should not be the way I've done it above because gc.spreadsheets().values().get() method accepts rather sth like 'B2' when talking about cell ranges and not the id) + another problem is that this solution will work only if every row of my first sheet will have a hyperlink to that second sheet (I want to connect one value to another in the end) - so if one raw will not contain it then I loose the whole order and I have a huge problem.
The ideal situation would be to get the hyperlink of a specific cell in a loop and then connect it to the value of the hyperlinked cell from another sheet.