Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This simple demo demonstrates how to use ConfiForms Field Definition of type "Action Button" to increment a value in a different field

ConfiForms Form Definition
formNamef
confluence-administratorsINLINE


ttnumbertrue

acIncrement number by 1t=([entry.t]+1)action_buttonok, good


ConfiForms ListView
formNamef

t

ac


Storage for this demo

Code Block
<ac:structured-macro ac:macro-id="9b274b94-76ae-4061-a37f-de0d86b2d8b2" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f1</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="bab13017-e926-4b57-9059-ca6c7e8c4a8b" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="bf47ab51-7b51-4534-ad29-2941dff59170" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">t</ac:parameter>
        <ac:parameter ac:name="fieldLabel">t</ac:parameter>
        <ac:parameter ac:name="type">number</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="3833daac-8681-4031-ace8-27350efe942e" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">ac</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Increment number by 1</ac:parameter>
        <ac:parameter ac:name="extras">t=([entry.t]+1)</ac:parameter>
        <ac:parameter ac:name="type">action_button</ac:parameter>
        <ac:parameter ac:name="separator">ok, good</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <br/>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="67d711c1-4e44-43da-97ca-28a641444fac" ac:name="confiform-list" ac:schema-version="1">
  <ac:parameter ac:name="formName">f1</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="71628126-fff2-408f-be52-10554cfc0110" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">t</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="f3bfc8b6-e4c7-433e-b45f-a0f594e27493" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">ac</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>