Thanks Dave and Clayton, these tips are UIPath gold!!!
Hi @yogeshgyw,
Take a look. Donât use the vb.net code . Only the activity will do all .
Regards
Balamurugan
custom activities have their place, but I am not a fan of using them extensively for everything.
It can be difficult for version control on the machines the robots run since they have to be manually moved and updated. The more robots and machines you have, the more difficult it is for upkeep.
I usually prefer to use the library of static sequences for things like this, or an invoked workflow library for more involved process. Of course, there are places where custom activities are nice to use, I just try not to over-rely on them
Hi ,
BalaReva.DataTable.Activities this package comes from the âhttps://gallery.uipath.com/â. The gallery is having lot of packages. These Packages are to do the process to very easy without struggling to do the code by vb.net .I donât think so it is difficult for version control. Below I have shown a published package which is opened from the nuget package manager.
So @yogeshgyw and friends , Let me know in case see any issues.
Thank You
Balamurugan
That worked out for me.
Thksss
Hi @ClaytonM,
Does your tblaccount is defined as datatable? Because when I try to do the same, it appears as follows:
I do not have any option regarding to AsEnumerable.
Thanks
Hi @Fer
If you are on version 2017 or older, it wonât be listed. It should be listed in 2018. Even if it isnât listed though, it should still be recognized as correct syntax. You can probably also use .select like tblaccount.Select.Sum()
⌠i think.
But like I said, even if itâs not listed, you can type it out and it should still work.
Regards.
@ClaytonM, my version is older than 2017, thatâs why is not working. I tried with tblaccount.Select.Sum() and also is not working.
Can you show what errors you get?
Hi,
Try like this,
yourDataTable.AsEnumerable().Sum(Function(row) row.Field(Of Integer)(âyourColumnNameâ))
I hope the column may integer datatype
its not method, simple linq query.
Use an Assign activity.
Declare a Integer variable and put this query to that variable
Hello @Fer,
can you check the variable is look like this or different ?
Simple aproch is like this
Convert.ToInt32(alphaLetterExcel.Compute(âSUM(Salary)â, String.Empty))
you can take knowledge from here (follow only the vb.net code)
http://learndotnetown.blogspot.com/2015/04/calculate-sum-total-of-datatable.html
Regards
Balamurugan.S
You might need to just type it out even if it is not listed. If you get a validation error (like blue mark), then let us know. Also @balupad14 makes good suggestions.
Hi @Fer,
I have tested your scenario. Yes I am getting the same error. Why ? Because when you read the data from excel to datatable everything is string. So here you are trying to do the sum with string column. That is the reason you are getting this error. If the column is integer , you wonât get this error. you have 2 solution for this.
Solution 1 (More work.)
- You have to convert the column as integer
- Or else add new column (tempVal) with datatype as integer.and convert all values to integer to this column(tempVal)
Solution 2 (Single Drag and drop.)
- Use the sum activity from âdatatable extensionâ bellow video attached.
You can get it from UiPath Go also.
Sample Project : Fer.zip (7.9 KB) (The sample studio version is 2018.4.0)
Regards
Balamurugan.S