How to display check box

Hi,

How to show a checkbox like below

Thanks a lots

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to ojask2243

    You can save the checkboxes field value to separate local variables and use the joinarray function to save the data into DB.

  •  

    a!localVariables(
      local!value1,
      local!value2,
      /*to save DB*/
      local!value,
    
    {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!checkboxField(
                label: "Checkboxes",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Option 1", "Option 2"},
                choiceValues: {1, 2},
                value: local!value1,
                saveInto: {local!value1, if(a!isNotNullOrEmpty(local!value2) ,a!save(local!value, joinarray(local!value1,local!value2)), a!save(local!value,local!value1))},
                validations: {}
              )
            }
          ),
          a!columnLayout(
            contents: {
              a!checkboxField(
                label: "",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Option 3", "Option 4"},
                choiceValues: {3, 4},
                value: local!value2,
                saveInto: {local!value2, if( a!isNotNullOrEmpty(local!value1) ,a!save(local!value, joinarray(local!value1,local!value2)), local!value2)},
                validations: {}
              )
            }
          ),
          a!columnLayout(
            contents: {}
          )
        }
      )
    }
    )

    I also think that, but when dose it save value into DB after chose checkbox field?

  • 0
    Certified Lead Developer
    in reply to ojask2243

    Appian does not store any data to your database automatically. I recommend to check the Appian Academy and Tutorials to understand how Appian works.

  • 0
    Certified Senior Developer
    in reply to ojask2243

    Something like the below:

    a!localVariables(
      local!value1,
      local!value2,
      {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!checkboxField(
                  label: "Checkboxes",
                  labelPosition: "COLLAPSED",
                  choiceLabels: {"Option 1", "Option 2"},
                  choiceValues: {1, 2},
                  value: local!value1,
                  saveInto: local!value1,
                  validations: {}
                )
              }
            ),
            a!columnLayout(
              contents: {
                a!checkboxField(
                  label: "",
                  labelPosition: "COLLAPSED",
                  choiceLabels: {"Option 3", "Option 4"},
                  choiceValues: {3, 4},
                  value: local!value2,
                  saveInto:local!value2,
                  validations: {}
                )
              }
            ),
            a!columnLayout(
              contents: {
                a!buttonLayout(
                  a!buttonWidget(
                    label:"Submit",
                    saveInto: {
                      a!writeToDataStoreEntity(
                        dataStoreEntity: {your_entity_constant},
                        valueToStore: updatedictionary(
                          your_local_varible_which_you_have_to_Insert,
                          {
                            fieldName_in_Which_you_want_to_store:joinarray({local!value1,local!value2},";") 
                          }
                        )
                      )
                    }
                  )
                )
              }
            )
          }
        )
      }
    )

  • 0
    Certified Lead Developer
    in reply to Deepak gupta

    Now you can replace updatedictionary() with a!update()