> 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/variables/decrease-variable.md). Agents can also search and read this documentation through its [MCP server](https://docs.gpmautomate.com/~gitbook/mcp).

# Decrease variable

Decrease variable 用于从一个变量中减去一个数值（该数值在 Decrease by 中设定）。

在 Output variable（输出变量）栏中，您可以填写与旧变量相同的名称以进行累减，或填写一个完全不同的变量名称以将结果保存到新变量中，而不改变旧变量的值。

* Decrease by：想要减去的数量（例如：`1`、`2`、`5`……）。
* 例如：您有一个变量 `$countdown = 10`。

  * 如果 *Output variable* 填写为 `$countdown`，*Decrease by* 填写为 `1` ➡️ 变量 `$countdown` 将减少为 `9`（累减）。
  * 如果 *Output variable* 填写为 `$previousRow`，*Decrease by* 填写为 `1` ➡️ 变量 `$countdown` 仍保持为 `10`，而新变量 `$previousRow` 的值将为 `9`。

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

<figure><img src="https://1806980278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiDNNiVZHPKSIcyshmOTB%2Fuploads%2Fgit-blob-6cf48c473786725996bdd436132b6a3e9bdefc34%2Fva-03.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/variables/decrease-variable.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.
