> 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/automate-zh/action-shi-yong-zhi-nan/text-and-number/random-text.md).

# Random text

Random text 是用于自动生成一串随机字符（包括字母和数字）的操作，长度可自定义，然后将其保存到一个输出变量（Output variable）中。

此操作通常用于在注册账号时生成新密码、生成身份识别码，或生成不重复的文本内容，以避免被系统扫描为垃圾信息。

🎥 查看更多教程视频：[点击这里](https://youtu.be/nlEQsaxawt4)。

#### 配置参数：

* Text Length：您想要生成的随机文本字符串的长度（字符数量）。

#### 实际示例：生成随机密码以自动注册账号

假设您正在编写一个在某网站上批量自动注册账号的脚本，并需要为每个账号填入一个随机密码以确保安全性：

* 配置方法：调用 Random text 操作，将 Text Length 字段设置为 `12`（生成长度为12个字符的字符串），并将 *Output variable* 字段设置为 `$randomPassword`。
* 结果：执行到此步骤时，系统将自动生成一串随机字符（例如：`"a7K39pXq2wLm"`）并保存到变量 `$randomPassword` 中。在接下来的步骤中，您只需调用 Key press 操作，将该 `$randomPassword` 变量传递到浏览器上的密码输入框中，即可完成注册。


---

# 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/automate-zh/action-shi-yong-zhi-nan/text-and-number/random-text.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.
