I wish to validate the all headers columns from input file. Bot will throw the exception to the user if expected header columns are not there in the input excel file. How can achieve this by Linq.?
expectedHeaders is of DataType Array(System.String)
=> Use Read Range Workbook to read the excel and store the output in a datatable.
=> Use below syntax in assign acitivty:
missingHeaders is of DataType System.Collections.Generic.List(System.String)
=> Use an If acitivty and give below condition
If
missingHeaders.Any()
Then
Throw -> new Exception("Missing headers: " + String.Join(", ", missingHeaders))
Else
Log Message -> "Headers Matched"
End If
Refer the below workflow for better understanding: Sequence.xaml (8.2 KB)