Uipath Invoke Method & 数组列表

要求:PR Code唯一,同一个月的同一个人的放在一起(例如 2019-10和2019-11 不放在一起,2019-10和2019-10放在一起),

开始的时候写(错误的写法):

 

Uipath Invoke Method & 数组列表

 

Uipath Invoke Method & 数组列表

 

 

 

1.read range(忽略)

2.For each(Item 的类型是System.String[])

dt.Rows.Cast(Of System.Data.DataRow).

Where(Function(r) r("Note").ToString = "ok to submit").

Select(Function(r) {r("Staff name").ToString, Left(r("Date").ToString, 7)}).

Distinct()

Invoke Method:

 

Uipath Invoke Method & 数组列表

 

因为数组不能被Distinct,  {r("Staff name").ToString, Left(r("Date").ToString, 7)} , 所以需要用另外一种写法

正确的写法:

 

Uipath Invoke Method & 数组列表

 

dt.Rows.Cast(Of System.Data.DataRow).

Where(Function(r) r("Note").ToString = "ok to submit").

Select(Function(r) r("Staff name").ToString + "|" + Left(r("Date").ToString, 7)).

Distinct()

名字加日期去筛选,Item的类型改为String

Invoke Method 的参数改为  item.Split({"|"}, StringSplitOptions.None):

 

Uipath Invoke Method & 数组列表

 

这里item.Split({"|"}, StringSplitOptions.None) 返回的数组

groups的类型:

 

Uipath Invoke Method & 数组列表

加入到GROUP后就是不重复的人名加日期了

相关文章:

  • 2021-05-24
  • 2021-05-31
  • 2021-12-13
  • 2022-02-06
  • 2021-10-12
  • 2021-11-23
  • 2022-12-23
  • 2021-08-03
猜你喜欢
  • 2021-05-22
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-09-16
  • 2022-01-29
相关资源
相似解决方案