Question

I want to check an excel file and sen an error

  • 22 February 2022
  • 1 reply
  • 18 views

Hi,

I'm trying to build a process for which the bot Check a column and trow an error if:

in a column there are any duplicate data

in some line in that specific column an information is missing.

I tried but is not catching the duplication error. Any ideas?​


1 reply

Userlevel 4
Badge +7

Hi @zeno gALLI​ ,

 

The way I would approach this is by connecting to Excel like it were a Database and leverage the SQL operations to my advantage.

 

SELECT [ColumnName], COUNT ([ColumnName])

FROM [SheetName$$]

GROUP BY [ColumnName]

HAVING COUNT([ColumnName])>1

 

Then you can check if the DataTable is empty, if so then there are no issues, and if it contains data, that means you have to Throw an exception:

 

ThrowExceptionIfDuplicate 

Kind Regards,

Ashwin A.K

 

 

Reply