Checkbox False Value Not being saved

Hi,

I have checked all the posts for how to capture the values from a checkbox and save it to an output CDT data element, but nothing has worked.

In my form, I have the following checkbox code where the only thing I want to do is if checked the value is true, if not cheched the value is false. I added a local variable (local!reqdoc) to hold the selected value.

                     a!checkboxField(
                        label: "",
                        labelPosition: "ABOVE",
                        choiceLabels: {"Requirements documentation"},
                        choiceValues: {true},
                        value: if(local!reqdoc, true, null),
                        saveInto: a!save(local!reqdoc, if(isnull(save!value), false, true))
                        )

In the Submit button component, I added the following code with a!save()

        a!buttonWidget(
          label: "Submit",
          saveInto: {
            a!save(ri!requests.status, "Submitted"),
            a!save(ri!requests.requirements, local!reqdoc)
          }

If I check the checkbox, it saves as true, however, if the checkbox is not checked the value that is saved is null. 

Can someone help me to fix this?

Thank you,

Roberta

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data