Reset or clear input after change made with another input

I want to clear the input for a radio button after I change the state of another radio button 

Example once I change the state of radio button to Tier 2 Additional Request From I want "What tier outputs does this request cover? " to reset if it was previously selected

a!radioButtonField(
label: "What application are you submitting? ",
labelPosition: "ABOVE",
choiceLabels: {"Tier 1 Service Output Form", "Tier 2 Additional Request Form", "Tier 3 Service Output Form"},
choiceValues: {"Tier 1 Service Output Form", "Tier 2 Additional Request Form", "Tier 3 Service Output Form"},
value: ri!svcRequest.submitted_app_type,
saveInto: ri!svcRequest.submitted_app_type,
required: true,
choiceLayout: "STACKED",
validations: {}
)
a!radioButtonField(
label: "What tier outputs does this request cover? ",
labelPosition: "ABOVE",
choiceLabels: {"1A", "1B"},
choiceValues: {"1A", "1B"},
value: ri!svcRequest.tier_output,
saveInto:ri!svcRequest.tier_output,
required: true,
choiceLayout: "STACKED",
validations: {}
),

  Discussion posts and replies are publicly visible

  • Hi there,

    You could try to set the "tier_output" to null in the saveInto of the first radio button. Please check if the code below helps:

    {
      a!radioButtonField(
        label: "What application are you submitting? ",
        labelPosition: "ABOVE",
        choiceLabels: {
          "Tier 1 Service Output Form",
          "Tier 2 Additional Request Form",
          "Tier 3 Service Output Form"
        },
        choiceValues: {
          "Tier 1 Service Output Form",
          "Tier 2 Additional Request Form",
          "Tier 3 Service Output Form"
        },
        value: ri!svcRequest.submitted_app_type,
        saveInto: {
          ri!svcRequest.submitted_app_type,
          a!save(ri!svcRequest.tier_output, null)
        },
        required: true,
        choiceLayout: "STACKED",
        validations: {}
      ),
      a!radioButtonField(
        label: "What tier outputs does this request cover? ",
        labelPosition: "ABOVE",
        choiceLabels: { "1A", "1B" },
        choiceValues: { "1A", "1B" },
        value: ri!svcRequest.tier_output,
        saveInto: ri!svcRequest.tier_output,
        required: true,
        choiceLayout: "STACKED",
        validations: {}
      )
    }

    Regards,

    Acacio B

  • This works but not if I want to save multiple variables as null on the page. given I am passing in more than 3 params for if statement.

    a!radioButtonField(
    label: "What application are you submitting? ",
    labelPosition: "ABOVE",
    choiceLabels: {
    "Tier 1 Service Output Form",
    "Tier 2 Additional Request Form",
    "Tier 3 Service Output Form"
    },
    choiceValues: {
    "Tier 1 Service Output Form",
    "Tier 2 Additional Request Form",
    "Tier 3 Service Output Form"
    },
    value: ri!svcRequest.submitted_app_type,
    saveInto: {
    ri!svcRequest.submitted_app_type,
    if(
    ri!svcRequest.submitted_app_type <> "Tier 2 Additional Request Form",
    a!save(ri!svcRequest.previous_janus_ex, null),
    a!save(ri!svcRequest.thirty_day_review, null),
    a!save(ri!svcRequest.service_componenet_comment, null)
    a!save(local!serviceComponents, null),
    )
    },
    required: true,
    choiceLayout: "STACKED",
    validations: {}
    )
    }
    ),
  • 0
    Certified Lead Developer
    in reply to oludareo0002

    You can do several a!save() operations at a time, however they'll need to be enclosed in an array.  Assuming that you want all 4 of those a!save() statements to be fired in the "true" condition of your if() statement, this is what you'd do:

    a!radioButtonField(
      label: "What application are you submitting? ",
      labelPosition: "ABOVE",
      choiceLabels: {
        "Tier 1 Service Output Form",
        "Tier 2 Additional Request Form",
        "Tier 3 Service Output Form"
      },
      choiceValues: {
        "Tier 1 Service Output Form",
        "Tier 2 Additional Request Form",
        "Tier 3 Service Output Form"
      },
      value: ri!svcRequest.submitted_app_type,
      saveInto: {
        ri!svcRequest.submitted_app_type,
        if(
          ri!svcRequest.submitted_app_type <> "Tier 2 Additional Request Form",
          {
            a!save(ri!svcRequest.previous_janus_ex, null),
            a!save(ri!svcRequest.thirty_day_review, null),
            a!save(ri!svcRequest.service_componenet_comment, null),
            a!save(local!serviceComponents, null)
          },
          {}
        )
      },
      required: true,
      choiceLayout: "STACKED",
      validations: {}
    )