> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/huong-dan-cac-action.md).

# HƯỚNG DẪN CÁC ACTION

- [📦Một số biến mặc định](https://docs.gpmautomate.com/huong-dan-cac-action/mot-so-bien-mac-dinh.md): Một số biến mặc định được dùng trong Automate
- [🧱Các block](https://docs.gpmautomate.com/huong-dan-cac-action/cac-block.md)
- [Normal block](https://docs.gpmautomate.com/huong-dan-cac-action/cac-block/normal-block.md): Khối lệnh tuần tự (Normal block)
- [For](https://docs.gpmautomate.com/huong-dan-cac-action/cac-block/for.md): For là khối lệnh dùng để lặp đi lặp lại một nhóm hành động với số lần được xác định trước. Vòng lặp này sử dụng một biến đếm mặc định là $loopIndex để theo dõi tiến trình lặp.
- [While](https://docs.gpmautomate.com/huong-dan-cac-action/cac-block/while.md): While là khối lệnh dùng để lặp đi lặp lại một nhóm hành động liên tục cho đến khi một điều kiện (Condition) được thỏa mãn thì mới dừng lại.
- [If, Else if và Else](https://docs.gpmautomate.com/huong-dan-cac-action/cac-block/if-else-if-va-else.md)
- [Hướng dẫn viết Điều kiện](https://docs.gpmautomate.com/huong-dan-cac-action/cac-block/huong-dan-viet-dieu-kien.md): Khi sử dụng các khối điều hướng như If, Else if, hoặc While, bạn cần thiết lập một biểu thức điều kiện để hệ thống kiểm tra lúc chạy. Biểu thức này sẽ trả về kết quả Đúng (true) hoặc Sai (false).
- [📊Variables](https://docs.gpmautomate.com/huong-dan-cac-action/variables.md)
- [Set variable](https://docs.gpmautomate.com/huong-dan-cac-action/variables/set-variable.md)
- [Increase variable](https://docs.gpmautomate.com/huong-dan-cac-action/variables/increase-variable.md): Increase variable dùng để cộng thêm một giá trị số (được xác định ở mục Increase by) vào một biến.
- [Decrease variable](https://docs.gpmautomate.com/huong-dan-cac-action/variables/decrease-variable.md): Decrease variable dùng để trừ đi một giá trị số (được xác định ở mục Decrease by) từ một biến.
- [Count](https://docs.gpmautomate.com/huong-dan-cac-action/variables/count.md)
- [⚙️Workflow](https://docs.gpmautomate.com/huong-dan-cac-action/workflow.md)
- [Exit loop](https://docs.gpmautomate.com/huong-dan-cac-action/workflow/exit-loop.md)
- [Next loop](https://docs.gpmautomate.com/huong-dan-cac-action/workflow/next-loop.md)
- [Stop](https://docs.gpmautomate.com/huong-dan-cac-action/workflow/stop.md)
- [Throw](https://docs.gpmautomate.com/huong-dan-cac-action/workflow/throw.md)
- [Delay](https://docs.gpmautomate.com/huong-dan-cac-action/workflow/delay.md): Dừng chờ trong 1 khoảng thời gian.
- [🔤Text & number](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number.md)
- [Random text](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/random-text.md)
- [Split text](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/split-text.md)
- [Read json](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/read-json.md)
- [Regex](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/regex.md)
- [Random number](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/random-number.md)
- [Math execute](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/math-execute.md)
- [2FA code](https://docs.gpmautomate.com/huong-dan-cac-action/text-and-number/2fa-code.md)
- [📁File & Folder](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder.md)
- [File exists](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-exists.md)
- [Copy file](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/copy-file.md)
- [Move/rename file](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/move-rename-file.md)
- [Delete file](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/delete-file.md): Xoá file theo đường dẫn File Path.
- [File read all text](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-read-all-text.md)
- [File read all lines](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-read-all-lines.md)
- [File read random line](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-read-random-line.md)
- [File write all text](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-write-all-text.md)
- [File append line](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/file-append-line.md)
- [Create empty excel](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/create-empty-excel.md)
- [Read excel file](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/read-excel-file.md)
- [Write excel file](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/write-excel-file.md)
- [Append excel file](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/append-excel-file.md): Thêm dữ liệu mới vào cuối một file excel hiện có mà không ghi đè nội dung hiện tại.
- [Folder exists](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/folder-exists.md)
- [Create folder](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/create-folder.md)
- [Move / rename folder](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/move-rename-folder.md)
- [Delete folder](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/delete-folder.md)
- [Folder get file list](https://docs.gpmautomate.com/huong-dan-cac-action/file-and-folder/folder-get-file-list.md)
- [📋Clipboard](https://docs.gpmautomate.com/huong-dan-cac-action/clipboard.md)
- [Get clipboard text](https://docs.gpmautomate.com/huong-dan-cac-action/clipboard/get-clipboard-text.md): Lấy nội dung văn bản hiện có trong clipboard.
- [Set clipboard text](https://docs.gpmautomate.com/huong-dan-cac-action/clipboard/set-clipboard-text.md)
- [🌐HTTP](https://docs.gpmautomate.com/huong-dan-cac-action/http.md)
- [HTTP Request](https://docs.gpmautomate.com/huong-dan-cac-action/http/http-request.md)
- [HTTP Download](https://docs.gpmautomate.com/huong-dan-cac-action/http/http-download.md): Tải xuống một file về máy tính thông qua giao thức HTTP.
- [🖼️Image Search](https://docs.gpmautomate.com/huong-dan-cac-action/image-search.md)
- [Wait to image](https://docs.gpmautomate.com/huong-dan-cac-action/image-search/wait-to-image.md)
- [Image exists](https://docs.gpmautomate.com/huong-dan-cac-action/image-search/image-exists.md)
- [Image search](https://docs.gpmautomate.com/huong-dan-cac-action/image-search/image-search.md)
- [Ví dụ kết hợp cho Image](https://docs.gpmautomate.com/huong-dan-cac-action/image-search/vi-du-ket-hop-cho-image.md)
- [Image to Base64](https://docs.gpmautomate.com/huong-dan-cac-action/image-search/image-to-base64.md)
- [🤖AI](https://docs.gpmautomate.com/huong-dan-cac-action/ai.md)
- [ChatGPT](https://docs.gpmautomate.com/huong-dan-cac-action/ai/chatgpt.md)
- [DeepSeek](https://docs.gpmautomate.com/huong-dan-cac-action/ai/deepseek.md)
- [📧Mail](https://docs.gpmautomate.com/huong-dan-cac-action/mail.md)
- [Read mail code](https://docs.gpmautomate.com/huong-dan-cac-action/mail/read-mail-code.md)
- [Read outlook (Oauth2)](https://docs.gpmautomate.com/huong-dan-cac-action/mail/read-outlook-oauth2.md)
- [🧭Navigation](https://docs.gpmautomate.com/huong-dan-cac-action/navigation.md)
- [New tab](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/new-tab.md)
- [Active tab](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/active-tab.md)
- [Close tab](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/close-tab.md)
- [Close all tab](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/close-all-tab.md)
- [Go to URL](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/go-to-url.md)
- [Back URL](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/back-url.md)
- [Reload](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/reload.md)
- [Get URL](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/get-url.md)
- [Wait URL Changed](https://docs.gpmautomate.com/huong-dan-cac-action/navigation/wait-url-changed.md)
- [🎯Element](https://docs.gpmautomate.com/huong-dan-cac-action/element.md)
- [Wait element](https://docs.gpmautomate.com/huong-dan-cac-action/element/wait-element.md)
- [Get element attribute](https://docs.gpmautomate.com/huong-dan-cac-action/element/get-element-attribute.md)
- [Get element text](https://docs.gpmautomate.com/huong-dan-cac-action/element/get-element-text.md)
- [Count element](https://docs.gpmautomate.com/huong-dan-cac-action/element/count-element.md)
- [🖱️Mouse](https://docs.gpmautomate.com/huong-dan-cac-action/mouse.md)
- [Mouse click](https://docs.gpmautomate.com/huong-dan-cac-action/mouse/mouse-click.md): Click chuột vào một element.
- [Mouse try to click](https://docs.gpmautomate.com/huong-dan-cac-action/mouse/mouse-try-to-click.md)
- [Mouse move](https://docs.gpmautomate.com/huong-dan-cac-action/mouse/mouse-move.md)
- [Mouse press and hold](https://docs.gpmautomate.com/huong-dan-cac-action/mouse/mouse-press-and-hold.md)
- [Mouse release](https://docs.gpmautomate.com/huong-dan-cac-action/mouse/mouse-release.md)
- [Mouse scroll](https://docs.gpmautomate.com/huong-dan-cac-action/mouse/mouse-scroll.md)
- [⌨️Keyboard](https://docs.gpmautomate.com/huong-dan-cac-action/keyboard.md)
- [Key press](https://docs.gpmautomate.com/huong-dan-cac-action/keyboard/key-press.md): Gõ một nội dung lên trang web.
- [File upload](https://docs.gpmautomate.com/huong-dan-cac-action/keyboard/file-upload.md)
- [Select dropdown](https://docs.gpmautomate.com/huong-dan-cac-action/keyboard/select-dropdown.md)
- [📜Scroll](https://docs.gpmautomate.com/huong-dan-cac-action/scroll.md)
- [Random scroll](https://docs.gpmautomate.com/huong-dan-cac-action/scroll/random-scroll.md)
- [Scroll to top](https://docs.gpmautomate.com/huong-dan-cac-action/scroll/scroll-to-top.md)
- [Scroll to bottom](https://docs.gpmautomate.com/huong-dan-cac-action/scroll/scroll-to-bottom.md)
- [Scroll to element](https://docs.gpmautomate.com/huong-dan-cac-action/scroll/scroll-to-element.md)
- [🔀Switch](https://docs.gpmautomate.com/huong-dan-cac-action/switch.md)
- [Switch to default](https://docs.gpmautomate.com/huong-dan-cac-action/switch/switch-to-default.md)
- [Switch to frame](https://docs.gpmautomate.com/huong-dan-cac-action/switch/switch-to-frame.md)
- [Switch to popup](https://docs.gpmautomate.com/huong-dan-cac-action/switch/switch-to-popup.md)
- [🍪Cookie](https://docs.gpmautomate.com/huong-dan-cac-action/cookie.md)
- [Import cookie](https://docs.gpmautomate.com/huong-dan-cac-action/cookie/import-cookie.md)
- [Export cookie](https://docs.gpmautomate.com/huong-dan-cac-action/cookie/export-cookie.md)
- [⚠️Alert](https://docs.gpmautomate.com/huong-dan-cac-action/alert.md)
- [Accept alert](https://docs.gpmautomate.com/huong-dan-cac-action/alert/accept-alert.md)
- [Cancel alert](https://docs.gpmautomate.com/huong-dan-cac-action/alert/cancel-alert.md)
- [📑Tab & Popup](https://docs.gpmautomate.com/huong-dan-cac-action/tab-and-popup.md)
- [Wait popup](https://docs.gpmautomate.com/huong-dan-cac-action/tab-and-popup/wait-popup.md)
- [Has popup](https://docs.gpmautomate.com/huong-dan-cac-action/tab-and-popup/has-popup.md)
- [💻Javascript](https://docs.gpmautomate.com/huong-dan-cac-action/javascript.md)
- [Execute JS code](https://docs.gpmautomate.com/huong-dan-cac-action/javascript/execute-js-code.md)
- [Get extension id](https://docs.gpmautomate.com/huong-dan-cac-action/javascript/get-extension-id.md)
- [Screenshot](https://docs.gpmautomate.com/huong-dan-cac-action/javascript/screenshot.md)
- [🔗References](https://docs.gpmautomate.com/huong-dan-cac-action/references.md)
- [Call workflow](https://docs.gpmautomate.com/huong-dan-cac-action/references/call-workflow.md)
- [📊Google service](https://docs.gpmautomate.com/huong-dan-cac-action/google-service.md): Đọc và ghi nội dung lên Google Sheets
- [Read google sheet](https://docs.gpmautomate.com/huong-dan-cac-action/google-service/read-google-sheet.md)
- [Write google sheet](https://docs.gpmautomate.com/huong-dan-cac-action/google-service/write-google-sheet.md): Ghi dữ liệu lên trên google sheet
- [📱Phone - App](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app.md)
- [Install app](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app/install-app.md): Cài đặt file ứng dụng (.apk) từ máy tính lên thiết bị điện thoại.
- [Is app installed](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app/is-app-installed.md): Kiểm tra một ứng dụng đã được cài trên thiết bị hay chưa.
- [Uninstall app](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app/uninstall-app.md): Gỡ cài đặt một ứng dụng khỏi thiết bị theo tên gói.
- [Start app](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app/start-app.md): Mở (khởi chạy) một ứng dụng đã cài trên thiết bị.
- [Stop app](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app/stop-app.md): Buộc dừng (force stop) một ứng dụng đang chạy trên thiết bị.
- [Clean app data](https://docs.gpmautomate.com/huong-dan-cac-action/phone-app/clean-app-data.md): Xóa toàn bộ dữ liệu của một ứng dụng, đưa app về trạng thái như mới cài.
- [📲Phone - Device](https://docs.gpmautomate.com/huong-dan-cac-action/phone-device.md)
- [Lock device](https://docs.gpmautomate.com/huong-dan-cac-action/phone-device/lock-device.md): Khóa màn hình thiết bị.
- [Unlock device](https://docs.gpmautomate.com/huong-dan-cac-action/phone-device/unlock-device.md): Đánh thức và mở khóa màn hình thiết bị.
- [Toggle service](https://docs.gpmautomate.com/huong-dan-cac-action/phone-device/toggle-service.md): Bật/tắt một dịch vụ hệ thống trên thiết bị (Airplane mode, Wi-Fi, Mobile data, Location).
- [Check network](https://docs.gpmautomate.com/huong-dan-cac-action/phone-device/check-network.md): Kiểm tra kết nối mạng của thiết bị bằng cách ping tới Google.
- [Reconnect](https://docs.gpmautomate.com/huong-dan-cac-action/phone-device/reconnect.md): Kết nối lại ADB — reset kết nối ADB giữa điện thoại và máy tính.
- [🧭Phone - Navigation](https://docs.gpmautomate.com/huong-dan-cac-action/phone-navigation.md)
- [Press back](https://docs.gpmautomate.com/huong-dan-cac-action/phone-navigation/press-back.md): Nhấn nút Back (quay lại) trên thiết bị.
- [Press home](https://docs.gpmautomate.com/huong-dan-cac-action/phone-navigation/press-home.md): Nhấn nút Home để về màn hình chính.
- [Press menu](https://docs.gpmautomate.com/huong-dan-cac-action/phone-navigation/press-menu.md): Nhấn phím Menu của thiết bị.
- [📁Phone - File](https://docs.gpmautomate.com/huong-dan-cac-action/phone-file.md)
- [Push file](https://docs.gpmautomate.com/huong-dan-cac-action/phone-file/push-file.md): Đẩy (copy) một file từ máy tính vào thiết bị điện thoại.
- [Pull file](https://docs.gpmautomate.com/huong-dan-cac-action/phone-file/pull-file.md): Kéo (copy) một file từ thiết bị điện thoại về máy tính.
- [📋Phone - Clipboard](https://docs.gpmautomate.com/huong-dan-cac-action/phone-clipboard.md)
- [Copy clipboard](https://docs.gpmautomate.com/huong-dan-cac-action/phone-clipboard/copy-clipboard.md): Đọc nội dung clipboard của thiết bị và lưu vào biến.
- [Set clipboard](https://docs.gpmautomate.com/huong-dan-cac-action/phone-clipboard/set-clipboard.md): Đặt một đoạn văn bản vào clipboard của thiết bị.
- [Paste clipboard](https://docs.gpmautomate.com/huong-dan-cac-action/phone-clipboard/paste-clipboard.md): Dán nội dung clipboard vào một phần tử trên màn hình theo XPath.
- [👆Phone - Action](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action.md)
- [Hướng dẫn xác định XPath & toạ độ](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action/huong-dan-xac-dinh-xpath-va-toa-do.md): Dùng công cụ GPM UI Automator để lấy XPath hoặc toạ độ của phần tử trên màn hình điện thoại.
- [Touch](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action/touch.md): Chạm (tap) vào một phần tử theo XPath hoặc theo toạ độ trên màn hình.
- [Scroll](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action/scroll.md): Cuộn/vuốt màn hình thiết bị theo hướng hoặc theo toạ độ điểm đầu - điểm cuối.
- [Screenshot](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action/screenshot.md): Chụp ảnh màn hình thiết bị và lưu về máy tính.
- [Press key](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action/press-key.md): Gửi một sự kiện phím (key event) tới thiết bị.
- [Type text](https://docs.gpmautomate.com/huong-dan-cac-action/phone-action/type-text.md): Gõ một đoạn văn bản vào ô nhập liệu xác định bằng XPath.
- [🎯Phone - Element](https://docs.gpmautomate.com/huong-dan-cac-action/phone-element.md)
- [Get element data](https://docs.gpmautomate.com/huong-dan-cac-action/phone-element/get-element-data.md): Lấy một thuộc tính của phần tử trên màn hình theo XPath và lưu vào biến.
- [Has element](https://docs.gpmautomate.com/huong-dan-cac-action/phone-element/has-element.md): Kiểm tra một phần tử có tồn tại trên màn hình hay không, trả kết quả về biến.
- [💻Phone - Shell](https://docs.gpmautomate.com/huong-dan-cac-action/phone-shell.md)
- [Execute ADB](https://docs.gpmautomate.com/huong-dan-cac-action/phone-shell/execute-adb.md): Chạy một lệnh ADB nhắm tới thiết bị và lưu kết quả vào biến.
- [Execute CMD](https://docs.gpmautomate.com/huong-dan-cac-action/phone-shell/execute-cmd.md): Chạy một lệnh shell bên trong thiết bị (qua adb shell) và lưu kết quả vào biến.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/huong-dan-cac-action.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
