> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 写入数据到字典

## 指令说明

**描述：** 在字典中设置一对键值，若键名存在则修改值

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-05.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=ef605d363d5b129c526a3ade70a7a1d1" alt="写入数据到字典指令参数面板" width="652" height="376" data-path="helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-05.png" />

    | 参数     | 说明     |
    | ------ | ------ |
    | **字典** | 输入字典变量 |
    | **键名** | 输入键名   |
    | **值**  | 输入键值   |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-01.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=6c56bb81a8820d5184374e4b0c15a4c3" alt="写入数据到字典使用示例" width="851" height="156" data-path="helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-01.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-06.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=9b4686e22d7d0b4b2dbd98ebe7e1fd39" alt="写入数据到字典使用示例" width="649" height="378" data-path="helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-06.png" />

**该流程执行逻辑：**

本例演示【写入数据到字典】指令的配置与执行：

1. 选择要写入的字典变量，并设置键名和值。
2. 将该键值对写入字典；键名已存在时更新其对应的值。

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-02.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=d9126a1372a45171e889d05564b565ca" alt="写入数据到字典效果展示" width="834" height="199" data-path="helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-02.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-03.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=b6fdcc4410d86d57ba29ea59e805c197" alt="写入数据到字典效果展示" width="840" height="151" data-path="helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-03.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/QLw4prvAN-mejJU5/helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-04.png?fit=max&auto=format&n=QLw4prvAN-mejJU5&q=85&s=b4e483414c0d99e0c25c9339c20eb993" alt="写入数据到字典效果展示" width="839" height="219" data-path="helpcenter/commands/data-processing/images/setdictionarykeyvaluecommand-04.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
