I'm trying to get the URL of a range of cells, but getLinkUrl
always returns null
.
Here is what I tried:
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Liste");
var url = sheet.getRange("A1").getRichTextValue().getLinkUrl();
This returns: null
var test = sheet.getRange("A1").getRichTextValue().getText();
This returns: text
(which is the text in A1 so it's working, and so then I tried)
var test2 = sheet.getRange("A1").getRichTextValue().getLinkUrl();
This returns: null
(I didn't understand why, and so tried this instead)
var test3 = sheet.getRange("A1:A10").getRichTextValues();
This returns:
[ [ {} ],
[ {} ],
[ {} ],
[ {} ],
[ {} ],
[ {} ],
[ {} ],
[ {} ],
[ {} ],
[ {} ] ]
And so I'm lost, I really don't know how I can get the URL of a / many cell.
In the documentation, there is an explanation about getLinkUrl
returning null
if there are multiple URLs but I don't know how to extract only one URL.
The sheet I'm working with is really simple, there are words only in the A column,
appli
info
motivation
anime
dev perso
reflexion
funny
sad