UiPath Datatable Practical Interview Question
-
Generate an output table to find employees who have the highest salary in each of the department Employees with the highest salary appearing first should be returned
-
Employee Sheet
-
Department Sheet
-
Required Output
-
Solution:
One of the approach to solve this in UiPath is to add one column manually in the Employee Sheet "departmentname" which will save all the appropriate name according to the "departmentid"
Above will achieved by using "invoke code" activity with logic of mapping the "departmentid" to "departmentname" This activity will have argument of datatable type with direction set to "in/out" incase of reusing the same datatable variable.
Then use "DefaultView" method to arrange the column in the required format and use the linq query to get the required output.