Hoppa till huvudinnehållet

alternative to "nested if" statements

Kommentarer

3 kommentarer

  • Berend Veldkamp
    I've never heard of a 'binary radial button'. Do you mean a Radio Button?

     

    This looks like a typical case to use a Switch or Flow Switch activity.
    0
  • Tom Neer
    We commonly do what you are describing but there is an issue with the Radio Buttons. Radio Buttons are independent of each other in Workflow 4, so you will never get away from the If statements. What we do is after the Display Form, we create a text variable and check each radio button (if radio button is true) then we set the variable to the name of the Radio Button. That variable is then passed into a Switch. Hope that helps.

     

    Though we recommend if possible, switch to Workflow 5. It is so much better to develop in that Workflow 4.
    0
  • Berend Veldkamp
    I forgot about the fact that radiobuttons have separate result values. But there's a workaround:
    1. Make sure the Radio Buttons have a logical Argument Name, for instance the same value as the ID (RadioButton1, RadioButton2, etc)
    2. Instead of linking the output values to separate variables, use the Display Form's 'Form Results' property
    3. To get the Argument Name name of the selected radiobutton, do this:
    formResults.First(Function(kv) kv.Key.StartsWith("RadioButton") AndAlso kv.Value.Equals(True)).Key
    1. Use the result of that function in a Switch activity

     

     
    0

Du måste logga in om du vill lämna en kommentar.