2021-05-26 uipath 数据类型判断
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2021-05-26 uipath 数据类型判断相关的知识,希望对你有一定的参考价值。
参考技术A datatable.select:dt.select("[Status]='wait'")
#挑选出Column为“Status”里面包含wait
dt.Select("[username] = ‘" +Convert.ToString(name) +"’")
#使用变量挑选, 挑选出表格"username"列中,名字为变量name='vincent'
str.gettype
获取数据类型。
读取一个excel,得到datatable: dt1
循环每一行的第14个cell,看是否数字:
row(14).tostring.isNumeric
------------------------------------------------------------------------------------
判断一个值是否字典中的键:
VarName.Item(Key) – returns the Dictionary item by its key
VarName.Count – returns an Int32 value of the number of Dictionary items
VarName.ContainsKey(Key) – checks if the item with the given key exists in the Dictionary and returns a Boolean result
VarName.TryGetValue(Key, Value) – checks if an item with a given key exists in the Dictionary and returns a Boolean result and the value if found
Datatable
dt.rows(0).item(0).tostring #获取第0行0列的单元数据
dt.rows(dt.rows.count-1).item(dt.columns.count-1).tostring #获取最后一行最后一列数据
row(1).tostring.substring(row(1).tostring.indexof("CN")).tostring
可提取CN开头的字符串
UiPath循环活动Do While的介绍和使用
一、Do While的介绍
先执行循环体, 再判断条件是否满足, 如果满足, 则再次执行循环体, 直到判断条件不满足, 则跳出循环
二、Do While在UiPath中的使用
1. 打开设计器,在设计库中新建一个Flowchart

2.为Flowchart命名并设置存储路径

3.在Activities中搜索Assign,添加两个Assign控件到设计区

4.为两个Assign设置变量、变量数据类型

5. 在Activities中搜索While,并将Do While控件拖至设计区

6. 在Do While控件的Body中添加LogMessage用来打印num的值

7. 在DoWhile控件的Body中添加Assign控件,填写num变量每次循环+1的表达式,并在Do
While控件中的Condition填写判断表达式
注:While循环是限制性判断,然后再执行Body的表达式,而Do While循环则是先执行Body的表达式然后再判断

8. 点击运行,在Output中查看运行结果

UiPath交流群:465630324
以上是关于2021-05-26 uipath 数据类型判断的主要内容,如果未能解决你的问题,请参考以下文章