Hi
I have this Table in an excel file and i want to keep only the first row of each School
how can i do it
Use remove duplicates activity …
And provide the column name of "School"
…in the add column field and then it would remove the duplicates
Select compare individual columns and check has headers to give the column name
https://docs.uipath.com/activities/other/latest/user-guide/remove-duplicates-x
Cheers
Maybe an alternative way using the Datatable approach (If already reading the data as Datatable) :
OutputDT = DT.AsEnumerable.GroupBy(Function(x)x("School").ToString).Select(Function(x)x.First).CopyToDatatable
Here, DT
is the data read from Excel sheet as Datatable, OutputDT
is the filtered Datatable.
Let us know if you require further help on this.
my DataTables are declared but i get this error : ‘DT’ is not declared. It may be inaccessible due to its level of protection. At line 1
‘OutputDT’ is not declared. It may be inaccessible due to its level of protection. At line 1
These were modeled based on my variables. You can use the Datatable variables that you have created or output from Read Range
activity.
Note, OutpuDT
is to be created as a Datatable variable.
i did actually i modified them to the ones i have in workflow but still not working
Could you maybe re-paste the Expression again and check?
- Copy the Expression. Remove the Expression
- Save the Workflow.
- Paste the Expression back.
Also, Do show us with a Screenshot of How you have implemented it.
OutputDT.AsEnumerable().GroupBy(Function(x)x(“Text File Name”).ToString).Select(Function(x)x.First).CopyToDatatable
i added “()” after “AsEnumerable”
and did what you told me and it worked perfectly
Thank you so much
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.