首页 > 解决方案 > 如何附加到 Automation Anywhere 10.5 中的列表?

问题描述

列表开始为空。然后,如果满足某些条件,我想为循环中的每次迭代附加一个值。我在变量操作中看不到附加选项。

标签: automationrpaautomationanywhere

解决方案


您可以为此使用字符串拆分,假设您知道一个永远不会出现在您的值列表中的分隔符。我使用了分号,并且 $local_joinedList$ 开始为空。

If (certain condition is met)
    Variable Operation: $local_joinedList$;$local_newValue$ To $local_joinedList$
End If
String Operation: Split "$local_joinedList$" with delimiter ";" and assign output to $my-list-variable$

这将覆盖 $my-list-variable$。

如果您需要追加到现有列表,您可以先使用 String Join 以相同的方式执行此操作,将您的值追加到字符串,然后再将其拆分。

String Operation: Join elements of "$my-list-variable$" by delimiter ";" and assign output to $local_joinedList$

推荐阅读