# 变量

来源快照：`result_data_new_260518.json`

- 来源 ID：`1185200997111619589`
- 模块：前端逻辑编排
- 目录：逻辑编排设计器 - 变量和模型
- space ID：`1182582763689992228`
- 原文链接：未提供
- 产品基线：未提供

## 正文

## 一、功能背景及价值用途

在逻辑编排过程中，大量数据需输入和输出至逻辑流，为此，我们引入了变量功能以实现数据的存储和处理。变量的使用显著提升了逻辑编排的灵活性和效率。借助变量，用户能便捷地在逻辑流各环节间传递数据，完成复杂的数据处理和业务逻辑构建。此外，变量支持多种数据类型，包括数字、字符串、布尔值等，充分满足不同场景下的数据存储需求。

## 二、功能概述及使用说明

### 1、功能概述

内部管理变量，作为数据存储介质，以利于后续处理与输出。

1、

### 新建变量

新建变量的入口有很多，可以在变量菜单中新建

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201194805338114&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201194829365249&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

也可以在变量选择框中点击新建变量，这边如图以变量赋值节点为例子

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201190445735937&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201199051481088&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

 

2、

### 变量标识

变量标识是必填项

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201190377660422&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201199051481094&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)  
 变量标识是变量在当前逻辑流的唯一标识，所以不能重复，不能和其他变量重名

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201199024807937&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203389358082&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

也不可以和自定义方法重名

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201181914521602&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201168987676675&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

变量标识必须以字母开头，可以包含字母、数字、下划线

若不满足条件保存时会报错：变量格式错误

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201199051481102&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201173388083208&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

而且变量标识不能是关键字

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203219111940&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201173388083206&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

可点击后方复制图标来复制当前变量标识

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186259820548&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203396780032&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

3、

### 变量名称

变量名称是变量的展示名称

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203219111937&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201199051481097&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)  
现阶段变量名称也作为必填项

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201199124332544&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201173388083204&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

 

4、

### 变量类型

变量类型是用来描述当前变量的类型，涵盖了常见的几种类型。包括：基础类型、集合类型、自定义模型、数据集。默认使用基础类型的String(文本)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201194756513797&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201190426484740&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

鼠标移入类型编辑框中，可以展示下拉按钮和展开按钮，点击下拉按钮则展示类型下拉选择框，并且鼠标默认聚焦在下拉搜索框中，可以搜索需要的变量类型

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186259820556&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201207666581505&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

点击展开按钮，弹出变量类型设置弹窗，并且鼠标默认聚焦在下拉搜索框中，可以搜索需要的变量类型

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201194829365255&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203396780034&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

 基础类型的Dom(文档对象)属于比较特殊的基础类型。代表当前变量是会储存一个文档对象元素，在赋值变量时也是使用特殊的赋值方式

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201173388083201&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201173137563655&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

集合类型暂时只有数组，点击数组则会打开变量类型设置弹窗，可详细配置类型

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201169067950082&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203217973249&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

补齐类型后，可以保存，如图表示：一个数组，内部每一项都是字符串

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201177643753474&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

支持无限嵌套

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201173137563657&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201177607553028&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

支持，任意修改内部类型

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201181969629189&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201190377660417&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)  
 

 

 

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201203389358085&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

可点击新建模型直接创建模型，具体模型相关，参考模型

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201190377660424&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186259820560&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

这边新建个简单的模型给变量使用

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201181796114433&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186259820545&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186259820554&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201207707017218&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

新建数据集类型，同页面创建数据集类似，变量可使用数据集的字段

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201194805338118&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D) 

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201181969629192&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186265735170&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201190542786562&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

 

5、

### 变量默认值

变量初始化的时候默认的值，现在支持默认值的类型有：String(文本)、Boolean(布尔值)、Number(数字)，其中Number(数字)类型，只支持输入数字

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201177524805632&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201177524805634&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

6、

### 变量编辑和删除

变量菜单列表中可以编辑和删除变量

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201186265735175&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201181886881795&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201177643753476&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

![](https://weapp.eteams.cn/papi/file/preview?fileId=1185201177524805636&type=redirect&customParam=%7B%22isExtDist%22%3Atrue%2C%22distributeId%22%3A%22%22%2C%22externalId%22%3A%22%22%2C%22appId%22%3A%22%22%7D)

 

 

 

## 三、上下游关联功能点

变量赋值：用于对变量进行赋值，修改变量的值。[ _更多详情点击查看_](https://eteams.cn/community/help)

模型：是特殊的变量类型，用于描述变量的结构。[ _更多详情点击查看_](https://eteams.cn/community/help)
