In the image above. Is it possible to prepopulate the Risk Level field based on the value of Likelihood and Severity? The risk level column need to produce a score from the multiplying the likelihood by the severity selections.
Also, the risk level field bg color needs to change depending on the calculated value (low - green, medium - yellow, high - red)
On the Object > Binding Tab for your dropdownlist, check the box that says Specify Item Values to give a numerical value to each item
In my example i have three combos and the Risk Level heading is a textfield, not a text object (it needs to be to be coloured in code).
Note: I have the code triggering on the combo exit event which triggers after you click on an item in the combo box. You will need to add the same code to both the first and second dropdownlists so either performs the calculation.
//create variables var ddl1 = DropDownList1.rawValue var ddl2 = DropDownList2.rawValue
var calc = ddl1 + ddl2 //calculate the dropdownlist values
//if the variable is equal to or greater than 1 and less than 4, select the first item and colour the heading green if(calc >= 1 and calc < 4) then DropDownList3.rawValue = "1" Table1.Row1.Cell3.fillColor="0,255,0" endif
//if the variable is greater than 3 and less than 10, select the second item and colour the heading yellow if(calc > 3 and calc < 10) then DropDownList3.rawValue = "2" Table1.Row1.Cell3.fillColor="255,255,0" endif
//if the variable is 10, select the third item and colour the heading red if(calc == 10) then DropDownList3.rawValue = "3" Table1.Row1.Cell3.fillColor="255,0,0" endif
After making the selection of a second combo, the third combo changes and the title fills with colour.
As there is only 10 options in the calculation, you could also use a switch instead of if expression for this, but this is one case where an if expression is more compact.