Select certain data row values corresponding to a value in Data Table

Hi,

My Data Table (Excel Sheet) has Tax Reference Number, Client Name, and Tax Amount.

I have used excel application scope to read the excel file, use Read Range to output the data to the datatable and then use for each row to loop through the datatable.

How do I retrieve Tax Reference number and Tax Amount if Client name is for e.g. abc ?

Hi @RUmak,

your assign activity should look similar to that:

TaxRef = row.Item(“ColumnNameOfTaxReferenceNumber”).tostring

Should be the same logic as you are already using in your if condition.

Kind regards
Patrick

Hi Schwarzp,

Thanks, I am importing a client name argument and I want to check if the imported Client name is equals to ‘Client Name’ column in the datatable.
How do I write that ?

row.item(“Client Name”) equals ClientName

This gives ‘End of Expression Expected’ error.

i assume that your argument “ClientName” has the data type string. So please add a “.toString” after the row.item…

Just like that:
row.Item(“Client Name”).tostring equals ClientName

When you use expressions like row.Item(ColumnName) you always have to add what data type is the value saved in that specific row item.

Still the same error -

ClientName is In Argument with String Datatype

Hi set the condition like this
row.Item(“Client Name”).ToString.Equals(ClientName.ToStting)

Cheers @RUmak

This worked -

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.