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: 1719983813795.988
1 2 0.5 3 Some random: 1719983813796.449
1 1 1 2 Some random: 1719983813798.328
1 2 0.5 3 Some random: 1719983813798.134
4 4 1 8 Some random: 1719983813799.120
4 4 1 8 Some random: 1719983813800.892
7 8 0.88 15 Some random: 1719983813800.955
1 2 0.5 3 Some random: 1719983813801.169
8 9 0.89 17 Some random: 1719983813802.528
4 5 0.8 9 Some random: 1719983813802.002
100 1 100 101 Some random: 1719983813903.603
100 1 100 101 Some random: 1719983813904.083
2 3 0.67 5 Some random: 1719983813805.837
1 1 1 2 Some random: 1719983813806.655
1 2 0.5 3 Some random: 1719983813806.232
10 10 1 20 Some random: 1719983813808.323
1 2 0.5 3 Some random: 1719983813808.294
1 1 1 2 Some random: 1719983813810.483
100 50 2 150 Some random: 1719983813860.703
1 2 0.5 3 Some random: 1719983813810.870
11 13 0.85 24 Some random: 1719983813809.647
23 44 0.52 67 Some random: 1719983813791.903
1 2 0.5 3 Some random: 1719983813811.559
1 3 0.33 4 Some random: 1719983813811.228
5 5 1 10 Some random: 1719983813813.784
20 20 1 40 Some random: 1719983813814.585
1 1 1 2 Some random: 1719983813814.920
1 2 0.5 3 Some random: 1719983813814.590
1 3 0.33 4 Some random: 1719983813813.935
1 2 0.5 3 Some random: 1719983813815.873
5 5 1 10 Some random: 1719983813817.345
10 2 5 12 Some random: 1719983813826.699
2 2 1 4 Some random: 1719983813818.416
5 4 1.25 9 Some random: 1719983813820.359
3 2 1.5 5 Some random: 1719983813821.508
1 2 0.5 3 Some random: 1719983813820.597
2 2 1 4 Some random: 1719983813822.994
5 5 1 10 Some random: 1719983813822.696
3 3 1 6 Some random: 1719983813823.980
22 100 0.22 122 Some random: 1719983813745.747
3 3 1 6 Some random: 1719983813824.960
1 2 0.5 3 Some random: 1719983813823.713
1 1 1 2 Some random: 1719983813825.221
1 0 0 1 Some random: 1719983813826.988
1 2 0.5 3 Some random: 1719983813825.913
1 1 1 2 Some random: 1719983813826.099
33 33 1 66 Some random: 1719983813827.156
545 556 0.98 1101 Some random: 1719983813816.408
545 556 0.98 1101 Some random: 1719983813817.063
3 6 0.5 9 Some random: 1719983813825.208
1 2 0.5 3 Some random: 1719983813828.310
20 10 2 30 Some random: 1719983813839.480
12 12 1 24 Some random: 1719983813830.594
7 5 1.4 12 Some random: 1719983813832.069
11 14 0.79 25 Some random: 1719983813828.581
1 2 0.5 3 Some random: 1719983813831.777
2 2 1 4 Some random: 1719983813832.256
1 2 0.5 3 Some random: 1719983813832.272
24 1 24 25 Some random: 1719983813856.144
13 13 1 26 Some random: 1719983813834.126
100 10 10 110 Some random: 1719983813924.889
2 2 1 4 Some random: 1719983813835.230
5 0 0 5 Some random: 1719983813840.870
0 1 0 1 Some random: 1719983813835.345
5 5 1 10 Some random: 1719983813836.029
2 2 1 4 Some random: 1719983813837.250
-2 2 -1 0 Some random: 1719983813834.896
8 9 0.89 17 Some random: 1719983813838.600
15 1 15 16 Some random: 1719983813854.089
1 1 1 2 Some random: 1719983813841.963
1 1 1 2 Some random: 1719983813841.683
1 1 1 2 Some random: 1719983813842.960
1 2 0.5 3 Some random: 1719983813841.861
45 5 9 50 Some random: 1719983813883.912
2 2 1 4 Some random: 1719983813843.949
2 2 1 4 Some random: 1719983813844.984
5 10 0.5 15 Some random: 1719983813839.265
3 2 1.5 5 Some random: 1719983813845.534
11 13 0.85 24 Some random: 1719983813843.390
22 22 1 44 Some random: 1719983813846.996
2 2 1 4 Some random: 1719983813846.302
1 2 0.5 3 Some random: 1719983813846.330
5 5 1 10 Some random: 1719983813847.964
6 125 0.05 131 Some random: 1719983813729.280
23 32312 0 32335 Some random: 1719983781559.186
1 1 1 2 Some random: 1719983813849.754
1 2 0.5 3 Some random: 1719983813848.833
2 2 1 4 Some random: 1719983813850.571
100 200 0.5 300 Some random: 1719983813750.475
2 2 1 4 Some random: 1719983813851.259
3 5 0.6 8 Some random: 1719983813849.778
3 4 0.75 7 Some random: 1719983813851.095
1 2 0.5 3 Some random: 1719983813851.814
1 2 0.5 3 Some random: 1719983813852.933
5 8 0.62 13 Some random: 1719983813850.969
3 8 0.38 11 Some random: 1719983813849.879
1 1 1 2 Some random: 1719983813854.621
5 3 1.67 8 Some random: 1719983813857.427
10 5 2 15 Some random: 1719983813860.564
1 2 0.5 3 Some random: 1719983813855.215
2 2 1 4 Some random: 1719983813856.602
2 123 0.02 125 Some random: 1719983813736.158
480 60 8 540 Some random: 1719983814277.461
300 20 15 320 Some random: 1719983814138.987
123 321 0.38 444 Some random: 1719983813661.531
6 509 0.01 515 Some random: 1719983813356.361
10 5 2 15 Some random: 1719983813865.923
([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: 1719983813785.010
3 4 0.75 7 Some random: 1719983813885.100
1 2 0.5 3 Some random: 1719983813885.153
3 3 1 6 Some random: 1719983813887.500
2 5 0.4 7 Some random: 1719983813884.665
25.00 25.00 1 50 Some random: 1719983813888.998
555 666 0.83 1221 Some random: 1719983813778.666
2 4 0.5 6 Some random: 1719983813887.829
2 3 0.67 5 Some random: 1719983813889.900
2 4 0.5 6 Some random: 1719983813888.585
1 1 1 2 Some random: 1719983813891.249
7,8 3,6 7 Expression: [(7,8 + 3,6)] could not be calculated, Too many numbers or variables Some random: 7.43136891578768951719983813897
55 40 1.38 95 Some random: 1719983813907.086
2 8 0.25 10 Some random: 1719983813887.637
3 4 0.75 7 Some random: 1719983813893.879
1 2 0.5 3 Some random: 1719983813893.623
3 4 0.75 7 Some random: 1719983813894.314
1 2 0.5 3 Some random: 1719983813894.729
20 10 2 30 Some random: 1719983813906.234
3 4 0.75 7 Some random: 1719983813895.957



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