Page tree

Playground and DEMO space

This is a playground and demo space for ConfiForms and ConfiDoc addons developed and supported by Vertuna LLC

Most pages provide a storage format for the demo, so you can use the free add-on from Atlassian Confluence Source Editor to import this configuration into your Confluence and see it in action

To import examples from the storage format on Confluence Cloud please see this page

Please note, all the examples here are provided without any obligation and may or may not be incomplete or may have bugs, and we provide NO SUPPORT for these examples and demos.

Here is a simple demo to show how the formula fields can be used 

We have 2 types of fields for calculations:

  • Calculated - which is calculated ONLY when the record is created
  • Formula - which is calculated and re-calculated each time the record is saved (created or updated)

You can use any of the functions or operations documented here: Supported math operators, formulas and functions

There is also a way to do calculations with ConfiForms Field Definition Rules


Here we have a simple form with 4 fields:

2 of number types and 3 of formula types

We have the following formulas in this form:

  • ([entry.f1] + [entry.f2])
  • (ROUND([entry.f1] / [entry.f2],2))
  • CONCAT("Some random: ", ((RANDOM() + [entry.f1] - [entry.f2] + NOW())))

Example configuration of a formula field:


Stored data

f1

f2

My formula 0

My formula 1

My formula 2

2 2 1 4 Some random: 1715935265998.754
1 2 0.5 3 Some random: 1715935266005.325
1 1 1 2 Some random: 1715935266008.581
1 2 0.5 3 Some random: 1715935266008.905
4 4 1 8 Some random: 1715935266012.392
4 4 1 8 Some random: 1715935266013.786
7 8 0.88 15 Some random: 1715935266014.458
1 2 0.5 3 Some random: 1715935266014.447
8 9 0.89 17 Some random: 1715935266015.905
4 5 0.8 9 Some random: 1715935266016.033
100 1 100 101 Some random: 1715935266117.483
100 1 100 101 Some random: 1715935266118.004
2 3 0.67 5 Some random: 1715935266020.269
1 1 1 2 Some random: 1715935266022.782
1 2 0.5 3 Some random: 1715935266022.639
10 10 1 20 Some random: 1715935266025.335
1 2 0.5 3 Some random: 1715935266025.106
1 1 1 2 Some random: 1715935266027.387
100 50 2 150 Some random: 1715935266078.708
1 2 0.5 3 Some random: 1715935266028.172
11 13 0.85 24 Some random: 1715935266028.214
23 44 0.52 67 Some random: 1715935266010.338
1 2 0.5 3 Some random: 1715935266031.585
1 3 0.33 4 Some random: 1715935266031.821
5 5 1 10 Some random: 1715935266034.069
20 20 1 40 Some random: 1715935266035.833
1 1 1 2 Some random: 1715935266036.180
1 2 0.5 3 Some random: 1715935266036.037
1 3 0.33 4 Some random: 1715935266036.254
1 2 0.5 3 Some random: 1715935266038.791
5 5 1 10 Some random: 1715935266040.555
10 2 5 12 Some random: 1715935266049.841
2 2 1 4 Some random: 1715935266043.174
5 4 1.25 9 Some random: 1715935266044.092
3 2 1.5 5 Some random: 1715935266045.472
1 2 0.5 3 Some random: 1715935266044.142
2 2 1 4 Some random: 1715935266047.320
5 5 1 10 Some random: 1715935266048.046
3 3 1 6 Some random: 1715935266048.118
22 100 0.22 122 Some random: 1715935265971.498
3 3 1 6 Some random: 1715935266050.834
1 2 0.5 3 Some random: 1715935266050.113
1 1 1 2 Some random: 1715935266053.358
1 0 0 1 Some random: 1715935266055.168
1 2 0.5 3 Some random: 1715935266054.116
1 1 1 2 Some random: 1715935266056.664
33 33 1 66 Some random: 1715935266057.527
545 556 0.98 1101 Some random: 1715935266047.578
545 556 0.98 1101 Some random: 1715935266048.715
3 6 0.5 9 Some random: 1715935266057.130
1 2 0.5 3 Some random: 1715935266060.394
20 10 2 30 Some random: 1715935266073.730
12 12 1 24 Some random: 1715935266064.841
7 5 1.4 12 Some random: 1715935266068.259
11 14 0.79 25 Some random: 1715935266065.679
1 2 0.5 3 Some random: 1715935266068.634
2 2 1 4 Some random: 1715935266069.384
1 2 0.5 3 Some random: 1715935266069.293
24 1 24 25 Some random: 1715935266094.183
13 13 1 26 Some random: 1715935266073.780
100 10 10 110 Some random: 1715935266164.471
2 2 1 4 Some random: 1715935266078.804
5 0 0 5 Some random: 1715935266084.394
0 1 0 1 Some random: 1715935266079.793
5 5 1 10 Some random: 1715935266081.218
2 2 1 4 Some random: 1715935266082.616
-2 2 -1 0 Some random: 1715935266080.183
8 9 0.89 17 Some random: 1715935266084.921
15 1 15 16 Some random: 1715935266100.546
1 1 1 2 Some random: 1715935266086.700
1 1 1 2 Some random: 1715935266087.046
1 1 1 2 Some random: 1715935266088.697
1 2 0.5 3 Some random: 1715935266088.607
45 5 9 50 Some random: 1715935266130.191
2 2 1 4 Some random: 1715935266091.209
2 2 1 4 Some random: 1715935266092.148
5 10 0.5 15 Some random: 1715935266088.637
3 2 1.5 5 Some random: 1715935266095.698
11 13 0.85 24 Some random: 1715935266093.768
22 22 1 44 Some random: 1715935266096.242
2 2 1 4 Some random: 1715935266097.803
1 2 0.5 3 Some random: 1715935266097.904
5 5 1 10 Some random: 1715935266098.981
6 125 0.05 131 Some random: 1715935265980.802
23 32312 0 32335 Some random: 1715935233811.951
1 1 1 2 Some random: 1715935266101.029
1 2 0.5 3 Some random: 1715935266101.758
2 2 1 4 Some random: 1715935266103.017
100 200 0.5 300 Some random: 1715935266004.953
2 2 1 4 Some random: 1715935266105.126
3 5 0.6 8 Some random: 1715935266103.372
3 4 0.75 7 Some random: 1715935266105.791
1 2 0.5 3 Some random: 1715935266106.761
1 2 0.5 3 Some random: 1715935266107.329
5 8 0.62 13 Some random: 1715935266106.435
3 8 0.38 11 Some random: 1715935266105.615
1 1 1 2 Some random: 1715935266111.152
5 3 1.67 8 Some random: 1715935266114.093
10 5 2 15 Some random: 1715935266118.214
1 2 0.5 3 Some random: 1715935266113.340
2 2 1 4 Some random: 1715935266114.588
2 123 0.02 125 Some random: 1715935265994.224
480 60 8 540 Some random: 1715935266536.435
300 20 15 320 Some random: 1715935266397.213
123 321 0.38 444 Some random: 1715935265920.569
6 509 0.01 515 Some random: 1715935265616.957
10 5 2 15 Some random: 1715935266125.815
([entry.f1] + [entry.f2]) ([entry.f1] + [entry.f2]) Expression: [(ROUND(([entry.f1] + [entry.f2]) / ([entry.f1] + [entry.f2]),2))] could not be calculated, Unknown operator '[' at position 9 Expression: [(([entry.f1] + [entry.f2]) + ([entry.f1] + [entry.f2]))] could not be calculated, Unknown operator '[' at position 3 Expression: [CONCAT("Some random: ", ((RANDOM() + ([entry.f1] + [entry.f2]) - ([entry.f1] + [entry.f2]) + NOW())))] could not be calculated, Unknown operator '[' at position 39
100 200 0.5 300 Some random: 1715935266026.818
3 4 0.75 7 Some random: 1715935266126.357
1 2 0.5 3 Some random: 1715935266127.651
3 3 1 6 Some random: 1715935266130.729
2 5 0.4 7 Some random: 1715935266128.090
25.00 25.00 1 50 Some random: 1715935266132.975
555 666 0.83 1221 Some random: 1715935266022.724
2 4 0.5 6 Some random: 1715935266132.535
2 3 0.67 5 Some random: 1715935266134.425
2 4 0.5 6 Some random: 1715935266133.933
1 1 1 2 Some random: 1715935266137.282
7,8 3,6 7 Expression: [(7,8 + 3,6)] could not be calculated, Too many numbers or variables Some random: 7.32948873212613851715935266144
55 40 1.38 95 Some random: 1715935266153.994
2 8 0.25 10 Some random: 1715935266133.224



Storage format for this demo:

<ac:structured-macro ac:macro-id="e44fca82-119b-4e79-b70a-1d521f0f13e3" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">myform1</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="9930843c-b7ee-493d-b93d-6c91cf13da7a" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="embedded">true</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="c1d112a1-145d-4822-9263-57e7f1d95202" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">f1</ac:parameter>
        <ac:parameter ac:name="fieldLabel">f1</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="5b285aed-c238-42cb-8fb0-74b504f51edd" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">f2</ac:parameter>
        <ac:parameter ac:name="fieldLabel">f2</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="9981f97b-d090-401d-95d2-b19d45a4df9f" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">myformula1</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My formula 1</ac:parameter>
        <ac:parameter ac:name="extras">([entry.f1] + [entry.f2])</ac:parameter>
        <ac:parameter ac:name="type">formula</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="f6b5b3d7-3462-4068-b23c-2ccee3789f66" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">myformula2</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My formula 2</ac:parameter>
        <ac:parameter ac:name="extras">CONCAT("Some random: ", ((RANDOM() + [entry.f1] - [entry.f2] + NOW())))</ac:parameter>
        <ac:parameter ac:name="type">formula</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p>Stored data</p>
<ac:structured-macro ac:macro-id="1d573801-7d23-412f-aa1e-c3c04d1fcc63" ac:name="confiform-table" ac:schema-version="1">
  <ac:parameter ac:name="formName">myform1</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="dc71204e-5341-4543-af04-45ab036c827d" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">f1</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="12af5c9f-b5bb-475e-b9c1-470d60b3bd6c" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">f2</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="0c76996a-654f-4b77-848b-9d8b2212a85f" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">myformula1</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="9a8cf996-366b-4a8b-be43-da01d32dc449" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">myformula2</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
  • No labels