UiPath Documentation
apps
2021.10
false
Apps User Guide for Automation Suite
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

使用表达式

为了更好地理解如何将表达式和运算符链接在一起以创建更复杂的行为,请按照下面的示例进行操作。

For more information on the subject, see About Expressions and About Functions.

计算器

要构建一个简单的计算器,请按照以下过程进行操作。

步骤 操作

1

打开您现有的应用程序或启动一个新应用程序。

2

添加两个文本框,其间带有标签。

更改控件的名称,如下所示:

  • 第一个文本框: FirstNumber
  • 标签:+
  • 第二个文本框: SecondNumber

3

在第二个文本框之后添加另一个标签。

将名称更改为Sum

4

将以下表达式添加到Sum标签:

FirstNumber
SecondNumber

按照上述步骤操作后,结构和元素将如下图所示。

输入验证

要构建简单的输入验证,请按照以下过程进行操作。

步骤 操作

1

打开您现有的应用程序或启动一个新应用程序。

2

创建名为“DT”的新“Number”变量。

3

创建一个值绑定到Number变量的文本框。

添加默认文本0

4

Add a label with the following text: This value is greater than or equal to 5!. docs image

5

添加以下表达式:

=Number<5

当插入的数字小于 5 时,验证标签将隐藏。按照上述过程操作后,运行时应如下所示:

列总和

要从绑定到 Orchestrator 输出的表中引用所选行的信息,请按照以下过程进行操作。

在此示例中,我们将检索名为“年龄”的列的总和,其中包含表中列出的所有人的年龄。

步骤 操作

1

打开您现有的应用程序或启动一个新应用程序。

2

创建一个表,其中包含名为“名称”的列。

3

Bound the table column to an Orchestrator output by selecting it in the Data Source property. In this example we will pick a source called Out.out_datatable. docs image

4

创建一个标签,并在“文本”属性中写入SUM(AGE):

5

Create a second label right next to the first one and pick the Sum function and out.datable.Age from the Resources list.=Sum(out_datatable.Age) in the Text property. docs image

6

保存并预览应用程序。

  • 计算器
  • 输入验证
  • 列总和

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新