As the process becomes a little complex, we might want to write our own code as per the requirement.
More customization is possible in Uipath by using VB.Net.
We have an activity to achieve the above, let’s see how to use it…!!!
Example
Implementation using UiPath :
Let us implement a workflow which takes a sample data table as input and outputs the SUM of total sales.
Step 1:
Drag “Build Data Table” activity into the design panel and populate it with sample data.
Step 2:
Drag “Invoke Code” activity into the design panel.
Step 3:
In “Invoke Code” activity, click “Edit Arguments” option to pass the required parameters as below.
Note:
Sample_DT is our DataTable (IN Argument)
Sum is the summation result (OUT Argument)
Step 4:
In “Invoke Code” activity, click Code” option to write the execution code.
Note:
Below code is used to count the total sales of all the divisions
Dim row As DataRow
sum=0
For Each row In Sample_Dt.Rows
sum= cInt(row(“Sales Amount”).toString)+Sum
Next row
Step 5:
Drag “Message Box” activity into the design panel and pass the “Sum” value into it.
Step 6:
Finally, let’s run the project.
Now, we can see total sales value being displayed.
Click here to download the Source Code…
Hope it has helped you…