Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

503
Visualizações
How can I call a Google script from a Google site? (2022, "new" Sites)

TL;DR. See the accepted solution below, but in short: you cant do it!

OP frustration: it's infuriating that I could easily get to very clear documentation suggesting that this was still possible, while approaching this from another direction leads to equally clear documentation saying that it's not.


I'm trying to use Google Scripts to get (simple) access to the Sheets API. Tutorials on how to use Scripts from within a Google Sheet work fine for me. But I'd like to have the script run from a Google Site (so I can construct some HTML to display a result to the user). And I'm stuck really early in the process.

In my reading of the google docs, this link: https://developers.google.com/apps-script/guides/menus explains that I need to ...

  1. In a Google Site, click More > Manage site
  2. In the sidebar, click Apps Scripts, then Add new script to create a script that is bound to the site.

As I see it, the kebab menu, upper right by the edit window in the Site, is the More menu; and mine looks like the illustration below. No Manage site item. How do I attach a script to the site?

Then, to call the function you write in the script, they say...

  1. Return to the Google Site and edit a page. Type a label that will become a link, such as Click me, then highlight the text and select Insert > Link.

As with the other issue, when I highlight text (or right-click selected text, or...), I see no menu or other command.

Looking through older documentation, I wonder if this was the strategy for the "classic" Google Sites, but of course we're supposed to use "new" sites since 2021.

I have a feeling that I'm missing something simple, and would be grateful for help!

More menu: Version history, Make a copy, etc.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

All I can say is that this documentation is outdated and is already unavailable.

Script support for Google Sites (Sites Service for Apps Script) was already discontinued after the rebuilt version was released back in 2016.

Only the classic Google Sites can have script support. (Which means only those already created before the newer version's release is still supported and all created sites after that will not have any script support)

Discontinued:

discontinued

Even the actual API is limited to the classic Google Sites:

Sites API:

api

If what you want is to have a script that shows data from sheets to your site, what you could do is create a webapp and then embed it to your site. See references for more information.

Reference:

  • Apps Script - Sites
  • Sites API
  • Webapps
  • Embedding your webapp
  • Walkthrough
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda