How to save multiple values when pressing the submit button?

Hi Everyone,

 

I started recently using Appian and I was wondering if it is possible to save multiple values into their respective cdt's in a form when clicking the submit button. For example, when using the following code I am able to save the loggedInUser() value in a cdt.

primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        submit: true,
        style: "PRIMARY",
        value: loggedInUser(),
        saveInto: ri!cdt.typetext
      )
    }

 

However, I would also like to save the now() value in another cdt while using the same button. Does anybody know the function that I have to use in order to accomplish this? 

  Discussion posts and replies are publicly visible

Parents
  • Yes, you can perform multiple saves on any component that has a saveInto parameter.  

    Using your button as an example:

    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        submit: true,
        style: "PRIMARY",
        value: loggedInUser(),
        saveInto: {
          ri!cdt.typetext,
          local!user,
          a!save(
            target: ri!cdt.typeinteger,
            value: 123
          ),
          a!save(
            target: ri!cdt.typeboolean,
            value: true
          ),
          etc...
        }
      )
    }

    In this example, loggedinuser() would save to both ri!cdt.typetext and local!user because it will reference your 'value' parameter when you do not use an a!save() function.  The a!save() functions then allow you to save data to any values to any available variables.

    See this documentation as well: docs.appian.com/.../enabling_user_interaction.html

Reply
  • Yes, you can perform multiple saves on any component that has a saveInto parameter.  

    Using your button as an example:

    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        submit: true,
        style: "PRIMARY",
        value: loggedInUser(),
        saveInto: {
          ri!cdt.typetext,
          local!user,
          a!save(
            target: ri!cdt.typeinteger,
            value: 123
          ),
          a!save(
            target: ri!cdt.typeboolean,
            value: true
          ),
          etc...
        }
      )
    }

    In this example, loggedinuser() would save to both ri!cdt.typetext and local!user because it will reference your 'value' parameter when you do not use an a!save() function.  The a!save() functions then allow you to save data to any values to any available variables.

    See this documentation as well: docs.appian.com/.../enabling_user_interaction.html

Children