---
title: SetJsonValue
description: "根据传入的key赋值对应的value（保存数据）。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0377.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0377.html
indexId: 869b834397576783a3c17b916001728ece15a9e4d0ce1ff9049f855e9ab3772f102
---
# SetJsonValue

#### 函数功能

根据传入的key赋值对应的value（保存数据）。


#### 函数原型

```
APP_ERROR ConfigData::SetJsonValue(const std::string &key, const std::string &value, int pos = -1);
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| key | 输入 | 关键字。 |
| value | 输入 | 关键字对应的值。 |
| pos | 输入 | int型。 |


#### 返回参数说明

| 数据结构 | 运算说明 |
| --- | --- |
| APP\_ERROR | 程序执行返回的错误码，请参考APP\_ERROR说明。 |
