public-roadmap icon indicating copy to clipboard operation
public-roadmap copied to clipboard

[Playground] Change Default Selector in Export Code for Google Sheets

Open schaferyan opened this issue 2 years ago • 4 comments

Customers typically try to copy and paste the Google Sheets formula from Export to Code into their Google Sheets and expect it to work as is. Currently the default selector is always "suggestions.0.value" which leads to an error for most engines.

Screenshot 2023-05-17 at 2 43 02 PM

While the customer would still need to learn about how to modify the selector to get the data points they are interested in, at a minimum we can provide a different selector depending on which engine is used.

Potentially we could also have this change based on which element or key the user has clicked in the iFrame or JSON. However this might require more work.

Intercom

schaferyan avatar May 17 '23 21:05 schaferyan

This continues to be a source of confusion for Google Sheets users.

A user recently opened a Public Roadmap issue due to this:

https://github.com/serpapi/public-roadmap/issues/1335

schaferyan avatar Jan 08 '24 18:01 schaferyan

As part of #1406 I changed this to organic_results.0.title, on the basis that it's more likely to work on typical engines.

Freaky avatar Feb 20 '24 00:02 Freaky

Just to clarify, it currently shows organic_results.0.title for all engines, including Google News. CleanShot 2024-06-06 at 06 29 23

I mentioned this since a customer confused about this. Intercom

hilmanski avatar Jun 06 '24 06:06 hilmanski

I had a user run into some confusion with this, as well working with the Google Maps API

=SERPAPI_RESULT("engine=google_maps&type=search&google_domain=google.com&q=Coffee&ll=" & ENCODEURL("@40.7455096,-74.0083012,14z") & "&hl=en", "organic_results.0.title")

organic_results.0.title instead of local_results.0.title

Intercom

NateSkiles avatar Jul 25 '24 20:07 NateSkiles

Another request:

Intercom

alexbarron avatar Dec 30 '24 13:12 alexbarron

Thank you for your work on that @zyc9012! It seems that doesn't work consistently:

Google Trends API: Image

Google News API: Image

Not sure if I'm missing something.

marm123 avatar Sep 01 '25 11:09 marm123

@marm123 Thanks for double-checking! I think it's due to Cloudflare caching. Looking into it.


Purged the cache and it should work now.

zyc9012 avatar Sep 02 '25 06:09 zyc9012

Thank you @zyc9012! Seems there is still an issue:

Image

It works when not logged in/incognito:

Image

Is this expected, or perhaps there is something me and our users need to do beforehand (e.g., clear browser cache)?

marm123 avatar Sep 02 '25 11:09 marm123

@marm123 yeah I guess it's browser cache, could you try clearing the cache and see if it fixes the issue?

zyc9012 avatar Sep 08 '25 06:09 zyc9012

Looks to be working well now, thanks @zyc9012!

marm123 avatar Sep 08 '25 11:09 marm123