I have a large number of conditions in Excel that i want to use in a series of IF Activities.
Is it possible that instead of adding the conditions directly into the IF Activity i could read the excel file as a data table and take the conditions from there?
yes buddy @jon1302 you can get from a excel with if condition and assign it to a variable and you were going good budy
Here is your xaml and its resolved
Changes made were
1.converted the type stConditionValue to boolean from generic as it would be esy to pass in if condition as if will take only boolean
like this stConditionValue = Convert.ToBoolean(row(“Value”).ToString)
2. And add the if condition in the first for each row itself buddy
Kindly let know whether this works or not buddy and if it gets resolved kindly close the topic with the comment marked as solution that could help others looking for ideas under your topic buddy @jon1302
Buddy just pass it as GENERIC TYPE itself buddy @jon1302 remove the Convert.ToBoolean in front and change the variable type down in variable panel buddy @jon1302
The reason the i thought the GENERIC TYPE of either TRUE or FALSE can only be converted to boolean but we have string in excel like strSupplierTitle.Replace(" LTD"," LIMITED") = strCompanyName, so thats y, i didn’t notice the excel file attached and thought you were passing boolean value directly, sorry my bad,
Thanks, ill give it a go. Though if i enter the stConditionValue it still recognizes as a string and not a boolean and so errors. I think i may have a different way doing the calculations in excel.
No buddy @jon1302, actually it will take as boolean, the reason is we are using conditional operators (<,>,<=,>=,=) between two strings in excel, so the output would be of boolean type only and if condition can take that value…
The reason why i asked to keep the variable of stConditionValue as generic is it can take any value of type like string,integer and boolean as well, so its better to be in generic and it will be accepted in if condition as well
I tried with certain conditions and it worked buddy @jon1302