> For the complete documentation index, see [llms.txt](https://tailieu.smax.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tailieu.smax.ai/bot-auto/the-chuc-nang/the-nang-cao/google-sheet.md).

# Google Sheet

{% hint style="info" %}
Thẻ <mark style="color:orange;">**Google Sheet**</mark> được sử dụng để đọc hoặc ghi thông tin từ chatbot lên Google Sheet
{% endhint %}

Để sử dụng thẻ Google Sheet, bạn cần thêm tích hợp tài khoản Google. Xem hướng dẫn tại đây

{% content-ref url="/pages/QDDkzsN1CeptCra9rWMH" %}
[Google](/module-cai-dat/tich-hop/google.md)
{% endcontent-ref %}

**Hướng dẫn đọc thông tin từ Google Sheet**

{% hint style="warning" %}
Tính năng đang cập nhật
{% endhint %}

**Hướng dẫn ghi thông tin lên Google Sheet**

{% hint style="warning" %}
Tài khoản Google tích hợp vào SmaxAi phải có quyền chỉnh sửa trên file Google Sheet
{% endhint %}

Để ghi thông tin lên Google Sheet, bạn cần chọn tài khoản Google đã tích hợp vào SmaxAi <mark style="color:orange;">**(1)**</mark>, sau đó chọn <mark style="color:orange;">**Loại Lưu dữ liệu vào sheet (2)**</mark>

Phần <mark style="color:orange;">**Spreadsheet**</mark> chọn <mark style="color:orange;">**Tệp có sẵn (3)**</mark> và nhập đường dẫn của file vào ô <mark style="color:orange;">**Spreadsheet (4)**</mark>

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FUb13FQuYuiOPrsd50Wbt%2Fimage%201.png?alt=media&amp;token=43afa0b2-6aa4-4447-ab4a-c7b9a7aa81c7" alt=""><figcaption></figcaption></figure>

Sau khi hệ thống tải thông tin file Google Sheet, bạn chọn trang tính muốn ghi dữ liệu vào

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FG4cXKJj6aJuwXfyeUxHq%2Fimage%201.png?alt=media&amp;token=23485ebb-128b-4e56-838d-39c80c6ee831" alt=""><figcaption></figcaption></figure>

SmaxAi có thể ghi dữ liệu lên Google Sheet theo 2 cách

<mark style="color:orange;">**Attributes**</mark>: Lưu các thuộc tính lên lần lượt theo các cột

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2F6etIEpAJtdwQoeb48fay%2Fimage%201.png?alt=media&amp;token=bbf6810e-0770-432d-aeaa-e3aec1c00f09" alt=""><figcaption></figcaption></figure>

Ví dụ file gồm 4 cột Tên Page, ID Page, Tên Facebook, ID Facebook, thẻ Google Sheet sẽ lưu các thuộc tính <mark style="color:purple;">**{{facebook.page\_name}}**</mark>, <mark style="color:purple;">**{{facebook.page\_id}}**</mark>, <mark style="color:purple;">**{{facebook.name}}**</mark> và <mark style="color:purple;">**{{facebook.id}}**</mark> lần lượt lên các cột đó

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FAHBRMduenQZJ9VB6IAXd%2Fimage.png?alt=media&amp;token=c3a22078-0961-4530-987d-0e4c19f6d6c1" alt=""><figcaption></figcaption></figure>

<mark style="color:orange;">**Matching Column**</mark>: Tìm kiếm và lưu theo cột có sẵn

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FNhEz4fjI0HK2n3TJvtLw%2Fimage%201.png?alt=media&amp;token=2acbddc0-d0be-4028-9f3f-881d6bc5c79b" alt=""><figcaption></figcaption></figure>

Ví dụ: Bạn có 1 dòng có cột ID Facebook là fb5947623822002487, hệ thống sẽ tìm kiếm xem dòng nào có cột ID Facebook tương ứng và ghi các giá trị <mark style="color:purple;">**{{facebook.page\_name}}**</mark>, <mark style="color:purple;">**{{facebook.page\_id}}**</mark>, <mark style="color:purple;">**{{facebook.name}}**</mark> vào các cột còn lại

Nếu không tìm thấy dòng nào có ID Facebook là fb5947623822002487 hệ thống sẽ tự động tạo dòng mới

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FHkrtQJVq8wehnyI6O0tC%2Fimage.png?alt=media&amp;token=e827d367-687d-466c-a1b5-982643ac467d" alt=""><figcaption></figcaption></figure>
