We have an excel sent by the users that need to be processed that will contain the following data:
Variable Name | Condition 1 | Operator | Condition 2 | True Statement | False Statement
Ex:
MyVariable1 | A | = | B | They are the same | They are not the same
Myvariable2 | A | <> | B | The are different | They are not different
MyVariable3 | 1 | > | 2 | Bigger | Smaller
MyVariable4 | 1 | = | “” | Is Empty | Is not empty
…
The number of rows is undefined, we need to replace in a document “MyVariable1”, “MyVariable2”, “MyVariable3”… with the true statement or false statement depending if the condition is true or false (based on the 3 columns “Condition 1 / Operator / Condition 2”.
We managed to do that by assigning every element to a variable but it forced us to have a static table. How is it possible to implement it using a unknown numbers of row, unknown operator, and unknown variable name?
is there only one column in excel with all expression ? if its the case you can use read range activity (workbook) and inside For Each Row in DataTable you can split the value into array of string.
Create Array variable of type String and inside for each, assign the current row to this variable like this:
stringArrayVariable(0) = value is Variable Name
stringArrayVariable(1) = value is Condition 1
stringArrayVariable(2) = value is Operator
stringArrayVariable(3) = value is Condition 2
stringArrayVariable(4) = value is True Statement
stringArrayVariable(5) = value is They are not the same