> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-pt/tutoriais-e-exemplos/external-services/spreadsheet-data.md).

# Dados de uma planilha

Conteúdo da scene conduzido por uma Google Sheet, atualizado sem redeploy.

Controle o conteúdo da cena a partir de uma Google Sheet. Edite a planilha para alterar o nome do artista, a transmissão de vídeo e o wearable em destaque sem precisar publicar a cena novamente.

## Informações do projeto

**Mantido por:** Decentraland

[Ver código-fonte](https://github.com/decentraland/Read_Spreadsheet_Scene)

**Licença:** [Apache-2.0](https://github.com/decentraland/Read_Spreadsheet_Scene/blob/main/LICENSE). Consulte os termos originais antes de reutilizar; o código e os assets podem ter termos diferentes.

## Explorar o código

Estas ligações apontam para um instantâneo específico do código-fonte, para que as explicações continuem a ser úteis à medida que o desenvolvimento a montante prossegue. São referências para aprendizagem, não uma avaliação de segurança.

### Ler uma Google Sheet publicada como JSON

`getSpreadsheetData` solicita a planilha pelo endpoint Google Visualization (`gviz/tq?tqx=out:json`), remove o wrapper `setResponse(...)` e transforma cada linha em um objeto cujas chaves são os cabeçalhos das colunas.

**Contexto do projeto:** A planilha deve ser compartilhada para que qualquer pessoa com o link possa visualizá-la. `gid` seleciona a aba, e `headers=1` define a primeira linha como nomes das colunas.

**Referências do código-fonte:**

* [`getSpreadsheetData`](https://github.com/decentraland/Read_Spreadsheet_Scene/blob/57bb4086aed3054d69a74f33f20f2d86c4eb9bb6/src/scheduler.ts#L1-L47)

### Aplicar uma linha à cena

`updateFromSpreadsheet` lê uma linha e atualiza um banner `TextShape`, substitui a fonte do `VideoPlayer` da tela, troca o wearable exibido no dispensador e configura a ação de clique do dispensador para abrir o link de compra da linha.

**Contexto do projeto:** Nomes de colunas como `NowPlaying`, `VideoURL`, `WearableURN`, e `BuyURL` devem corresponder aos cabeçalhos da planilha. As Entities são localizadas pelos nomes definidos na cena do Creator Hub.

**Referências do código-fonte:**

* [`updateFromSpreadsheet`](https://github.com/decentraland/Read_Spreadsheet_Scene/blob/57bb4086aed3054d69a74f33f20f2d86c4eb9bb6/src/index.ts#L10-L64)
* [`createWearable`](https://github.com/decentraland/Read_Spreadsheet_Scene/blob/57bb4086aed3054d69a74f33f20f2d86c4eb9bb6/src/index.ts#L100-L130)

### Percorrer as linhas com um botão do Creator Hub

`main` escuta as ações `Next` e `Previous` na Entity `Switch Artist` e faz o índice da linha voltar ao início ao chegar ao fim dos dados baixados.

**Contexto do projeto:** Usa `getActionEvents` de `@dcl/asset-packs`, portanto, as ações são configuradas na Entity no Creator Hub.

**Referências do código-fonte:**

* [`main`](https://github.com/decentraland/Read_Spreadsheet_Scene/blob/57bb4086aed3054d69a74f33f20f2d86c4eb9bb6/src/index.ts#L69-L97)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-pt/tutoriais-e-exemplos/external-services/spreadsheet-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
