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: 1714059943079.377
1 2 0.5 3 Some random: 1714059943079.605
1 1 1 2 Some random: 1714059943081.622
1 2 0.5 3 Some random: 1714059943081.488
4 4 1 8 Some random: 1714059943082.959
4 4 1 8 Some random: 1714059943083.772
7 8 0.88 15 Some random: 1714059943083.868
1 2 0.5 3 Some random: 1714059943083.074
8 9 0.89 17 Some random: 1714059943084.988
4 5 0.8 9 Some random: 1714059943085.798
100 1 100 101 Some random: 1714059943186.554
100 1 100 101 Some random: 1714059943187.605
2 3 0.67 5 Some random: 1714059943087.725
1 1 1 2 Some random: 1714059943089.124
1 2 0.5 3 Some random: 1714059943088.264
10 10 1 20 Some random: 1714059943090.826
1 2 0.5 3 Some random: 1714059943089.655
1 1 1 2 Some random: 1714059943091.910
100 50 2 150 Some random: 1714059943142.858
1 2 0.5 3 Some random: 1714059943091.344
11 13 0.85 24 Some random: 1714059943091.137
23 44 0.52 67 Some random: 1714059943072.995
1 2 0.5 3 Some random: 1714059943093.106
1 3 0.33 4 Some random: 1714059943092.162
5 5 1 10 Some random: 1714059943095.495
20 20 1 40 Some random: 1714059943096.678
1 1 1 2 Some random: 1714059943097.549
1 2 0.5 3 Some random: 1714059943096.472
1 3 0.33 4 Some random: 1714059943096.133
1 2 0.5 3 Some random: 1714059943098.699
5 5 1 10 Some random: 1714059943099.917
10 2 5 12 Some random: 1714059943108.983
2 2 1 4 Some random: 1714059943100.778
5 4 1.25 9 Some random: 1714059943102.387
3 2 1.5 5 Some random: 1714059943102.114
1 2 0.5 3 Some random: 1714059943101.347
2 2 1 4 Some random: 1714059943102.005
5 5 1 10 Some random: 1714059943103.255
3 3 1 6 Some random: 1714059943103.466
22 100 0.22 122 Some random: 1714059943026.905
3 3 1 6 Some random: 1714059943104.795
1 2 0.5 3 Some random: 1714059943104.466
1 1 1 2 Some random: 1714059943105.657
1 0 0 1 Some random: 1714059943107.827
1 2 0.5 3 Some random: 1714059943105.992
1 1 1 2 Some random: 1714059943107.504
33 33 1 66 Some random: 1714059943107.539
545 556 0.98 1101 Some random: 1714059943097.914
545 556 0.98 1101 Some random: 1714059943097.161
3 6 0.5 9 Some random: 1714059943106.067
1 2 0.5 3 Some random: 1714059943108.789
20 10 2 30 Some random: 1714059943120.776
12 12 1 24 Some random: 1714059943110.558
7 5 1.4 12 Some random: 1714059943113.656
11 14 0.79 25 Some random: 1714059943108.220
1 2 0.5 3 Some random: 1714059943111.843
2 2 1 4 Some random: 1714059943112.609
1 2 0.5 3 Some random: 1714059943112.618
24 1 24 25 Some random: 1714059943136.378
13 13 1 26 Some random: 1714059943114.674
100 10 10 110 Some random: 1714059943204.543
2 2 1 4 Some random: 1714059943115.392
5 0 0 5 Some random: 1714059943120.968
0 1 0 1 Some random: 1714059943115.327
5 5 1 10 Some random: 1714059943116.615
2 2 1 4 Some random: 1714059943117.558
-2 2 -1 0 Some random: 1714059943113.557
8 9 0.89 17 Some random: 1714059943117.147
15 1 15 16 Some random: 1714059943132.640
1 1 1 2 Some random: 1714059943119.854
1 1 1 2 Some random: 1714059943119.951
1 1 1 2 Some random: 1714059943120.160
1 2 0.5 3 Some random: 1714059943119.400
45 5 9 50 Some random: 1714059943160.728
2 2 1 4 Some random: 1714059943121.601
2 2 1 4 Some random: 1714059943121.437
5 10 0.5 15 Some random: 1714059943117.878
3 2 1.5 5 Some random: 1714059943123.123
11 13 0.85 24 Some random: 1714059943121.440
22 22 1 44 Some random: 1714059943123.193
2 2 1 4 Some random: 1714059943124.126
1 2 0.5 3 Some random: 1714059943123.151
5 5 1 10 Some random: 1714059943125.560
6 125 0.05 131 Some random: 1714059943006.089
23 32312 0 32335 Some random: 1714059910837.057
1 1 1 2 Some random: 1714059943126.035
1 2 0.5 3 Some random: 1714059943126.219
2 2 1 4 Some random: 1714059943127.206
100 200 0.5 300 Some random: 1714059943028.367
2 2 1 4 Some random: 1714059943128.161
3 5 0.6 8 Some random: 1714059943127.782
3 4 0.75 7 Some random: 1714059943128.411
1 2 0.5 3 Some random: 1714059943129.326
1 2 0.5 3 Some random: 1714059943130.434
5 8 0.62 13 Some random: 1714059943128.306
3 8 0.38 11 Some random: 1714059943127.394
1 1 1 2 Some random: 1714059943132.160
5 3 1.67 8 Some random: 1714059943135.111
10 5 2 15 Some random: 1714059943138.692
1 2 0.5 3 Some random: 1714059943133.475
2 2 1 4 Some random: 1714059943135.349
2 123 0.02 125 Some random: 1714059943014.205
480 60 8 540 Some random: 1714059943556.456
300 20 15 320 Some random: 1714059943416.394
123 321 0.38 444 Some random: 1714059942939.203
6 509 0.01 515 Some random: 1714059942634.129
10 5 2 15 Some random: 1714059943143.470
([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: 1714059943042.699
3 4 0.75 7 Some random: 1714059943142.741
1 2 0.5 3 Some random: 1714059943142.683
3 3 1 6 Some random: 1714059943144.224
2 5 0.4 7 Some random: 1714059943141.997
25.00 25.00 1 50 Some random: 1714059943145.017
555 666 0.83 1221 Some random: 1714059943034.654
2 4 0.5 6 Some random: 1714059943144.492
2 3 0.67 5 Some random: 1714059943145.306
2 4 0.5 6 Some random: 1714059943145.726
1 1 1 2 Some random: 1714059943147.301



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