Form fields with formula

Hello,

I am working on several forms and I have the need to have a formula added to fields adding and subtracting and sum. Is there a way to do that in Appian?

Thanks!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The short answer is "yes", but if you're not used to the particular nature of Appian's scripting language, then the functionality available might not always fit your prior expectations.  Usually the resolution of this boils down to tempering expectations against the functionality available (as you get used to working with it), and once again as always we're here to help when you have some examples (even if just generic use cases) to provide us here.

  • Thank you Mike!

    I have inserted a quick form where I have added some decimal form fields, hopefully this way will help to get more clarity of what I am trying to accomplish...

    Thank you!

    a!formLayout(
      label: "Form with formula fields",
      contents: {
        a!floatingPointField(
          label: "Capital",
          labelPosition: "ABOVE",
          value: ri!capital,
          saveInto: ri!capital,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "(Gain) or Loss",
          labelPosition: "ABOVE",
          value: ri!gainLoss,
          saveInto: ri!gainLoss,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Market 1",
          labelPosition: "ABOVE",
          value: ri!market1,
          saveInto: ri!market2,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Market 2 (gain/loss)",
          labelPosition: "ABOVE",
          value: ri!market2,
          saveInto: ri!market2,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Income",
          labelPosition: "ABOVE",
          value: ri!income,
          saveInto: ri!income,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Total",
          labelPosition: "ABOVE",
          value: ri!total,
          saveInto: ri!total,
          refreshAfter: "UNFOCUS",
          validations: {}
        )
      },
      buttons: a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Submit",
            submit: true,
            style: "PRIMARY"
          )
        },
        secondaryButtons: {}
      )
    )

Reply
  • Thank you Mike!

    I have inserted a quick form where I have added some decimal form fields, hopefully this way will help to get more clarity of what I am trying to accomplish...

    Thank you!

    a!formLayout(
      label: "Form with formula fields",
      contents: {
        a!floatingPointField(
          label: "Capital",
          labelPosition: "ABOVE",
          value: ri!capital,
          saveInto: ri!capital,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "(Gain) or Loss",
          labelPosition: "ABOVE",
          value: ri!gainLoss,
          saveInto: ri!gainLoss,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Market 1",
          labelPosition: "ABOVE",
          value: ri!market1,
          saveInto: ri!market2,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Market 2 (gain/loss)",
          labelPosition: "ABOVE",
          value: ri!market2,
          saveInto: ri!market2,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Income",
          labelPosition: "ABOVE",
          value: ri!income,
          saveInto: ri!income,
          refreshAfter: "UNFOCUS",
          validations: {}
        ),
        a!floatingPointField(
          label: "Total",
          labelPosition: "ABOVE",
          value: ri!total,
          saveInto: ri!total,
          refreshAfter: "UNFOCUS",
          validations: {}
        )
      },
      buttons: a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Submit",
            submit: true,
            style: "PRIMARY"
          )
        },
        secondaryButtons: {}
      )
    )

Children
No Data