Showwhen Activity

can we write both and() and or() conditions in the showwhen activity. i have tried for a text field. if the checkbox is selected the textbox should appear. but it is also appearing in the next page. can anyone pls help

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    a!localVariables(
    local!text,
    local!checkbox,
    local!currentstep: 1,
    a!sectionLayout(
    contents: {
    a!textField(
    showWhen: and(local!checkbox="Show field",local!currentstep=1),
    label: "Text field",
    value: local!text,
    saveInto: local!text
    ),
    a!checkboxField(
    choiceLabels: {"Show field"},
    choiceValues: {"Show field"},
    saveInto: local!checkbox,
    value: local!checkbox
    
    ),
    
    }
    )
    )

    If you are using a milestone to display multiple steps, you can use the above condition for showWhen. Hope this will help you with your issue. 

Reply
  • +1
    Certified Senior Developer

    a!localVariables(
    local!text,
    local!checkbox,
    local!currentstep: 1,
    a!sectionLayout(
    contents: {
    a!textField(
    showWhen: and(local!checkbox="Show field",local!currentstep=1),
    label: "Text field",
    value: local!text,
    saveInto: local!text
    ),
    a!checkboxField(
    choiceLabels: {"Show field"},
    choiceValues: {"Show field"},
    saveInto: local!checkbox,
    value: local!checkbox
    
    ),
    
    }
    )
    )

    If you are using a milestone to display multiple steps, you can use the above condition for showWhen. Hope this will help you with your issue. 

Children