Skip to main content
Question

I want to check an excel file and sen an error

  • February 22, 2022
  • 1 reply
  • 35 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?​

Ashwin A.K
Forum|alt.badge.img+8
  • Navigator | Tier 3
  • February 22, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings