I’m stuck with a Google Sheets problem. I’ve got a column full of place smart chips. You know, those fancy cells where you can pop in a location from Google Maps.
Here’s the thing: my script can only grab the place name when I use getValues(). But I need both the name AND the Maps link for each place.
I’ve tried getDisplayValues() too, but no luck. Even getRichTextValues() doesn’t seem to give me that sweet, sweet URL.
Anyone know a trick to pull both bits of info from these smart chips using Apps Script? I’m scratching my head here!
I’ve actually encountered a similar issue with place smart chips in Sheets. Unfortunately, there’s no straightforward method to extract both the place name and URL using standard Apps Script functions. The smart chip data isn’t easily accessible through the usual channels.
One workaround I’ve found is to use the Maps API in conjunction with Apps Script. You can grab the place name with getValues(), then use that to query the Maps API for additional details including the URL. It’s not ideal, but it gets the job done.
Alternatively, you might consider using a custom function to generate both the name and URL when inputting locations, bypassing the smart chip limitation. It’s a bit more work upfront, but could save headaches down the line.
I’ve wrestled with this exact problem in my work projects. Here’s a sneaky trick I discovered: use the HYPERLINK function in a helper column. It can extract both the name and URL from smart chips.
Formula would look like: =HYPERLINK(REGEXEXTRACT(TO_TEXT(A1), “http."), REGEXEXTRACT(TO_TEXT(A1), "[1]”))
Then in your script, you can getValues() from this helper column to get both pieces of info. It’s not perfect - you’ll need to handle empty cells and potential errors - but it’s been a lifesaver for me.
Just remember to hide the helper column if you don’t want users messing with it. Hope this helps you out!
hey there, i feel ur pain with those smart chips! have u tried the Sheets API instead of Apps Script? might be worth a shot. it sometimes gives more data. or maybe u could use a custom menu to grab the info when u click on a cell? just brainstorming here. good luck!