Hello, please I have one variable as table type with some codes and I´d like to
put one condition for check if exist two codes in the lines of the table.
I am using For each row in table component and into this I included the If condition… but I have doubts for include the function for check each rows this table Can you help me how I check if exist two codes in the table?
thanks.
Hi @Felipe_Sternberg ,
If you are trying to check for two conditions and are using a For Each Row in DataTable activity, you could try this →
If you want to check if both codes are present in a given row:
CurrentRow(ColumnNameOrIndex)ToString.Equals("Code1") AndAlso CurrentRow(ColumnNameOrIndex)ToString.Equals("Code2")
If you want to check if either of the codes are present in a given row:
CurrentRow(ColumnNameOrIndex)ToString.Equals("Code1") OrElse CurrentRow(ColumnNameOrIndex)ToString.Equals("Code2")
Kind Regards,
Ashwin A.K
Hello, I´d like to know if for all rows in Data Table activity DON´T have one specific code (“BD”).
For example , I have 03 lines in Data Table (BD, 00, BD) and I need to do something ONLY if all rows are “BD”. Which condition I can to use?
hey
use the filter data table activity
regards
Hi @Felipe_Sternberg ,
Lets assume that you have the following two datatables →
Dt1 →
A|B|C
BD|00|BD
BD|BD|BD
Dt2 →
D|E|F
BD|BD|BD
BD|BD|BD
Not all rows in Dt1 contain the code BD, whereas all the items in Dt2 contain the code BD.
If you want Dt1 to evaluate to true, then this is what you have to use →
Dt1.AsEnumerable().Any(Function(a) a.ItemArray.Contains("BD"))
If you want all the items to contain the code, then Dt2 will evaluate to true with this →
Dt2.AsEnumerable().All(Function(a) a.ItemArray.Contains("BD"))
If this doesn’t answer your query then please provide some sample data because its difficult to provide resolutions based off assumptions.
Kind Regards,
Ashwin A.K