Page tree
Skip to end of metadata
Go to start of metadata

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

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

3 7 0.43 10 Some random: 1621009549420.941
8 9 0.89 17 Some random: 1621009549425.371
9 8 1.12 17 Some random: 1621009549429.107
.2 .2 Expression: [(ROUND(.2 / .2,2))] could not be calculated, Unknown operator '.' at position 8 Expression: [(.2 + .2)] could not be calculated, Unknown operator '.' at position 2 Expression: [CONCAT("Some random: ", ((RANDOM() + .2 - .2 + NOW())))] could not be calculated, Unknown operator '.' at position 38
2 2 1 4 Some random: 1621009549433.334
1 2 0.5 3 Some random: 1621009549435.807
33 2 16.5 35 Some random: 1621009549470.386
1 32 0.03 33 Some random: 1621009549411.817
1 2 0.5 3 Some random: 1621009549444.740
1 2 0.5 3 Some random: 1621009549447.159
1 1 1 2 Some random: 1621009549451.340
4 1 4 5 Some random: 1621009549458.665
123 123 1 246 Some random: 1621009549458.260
2 2 1 4 Some random: 1621009549460.761
3 4 0.75 7 Some random: 1621009549461.999
3 4 0.75 7 Some random: 1621009549463.148
3 2 1.5 5 Some random: 1621009549467.050
33 32 1.03 65 Some random: 1621009549469.388
5 5 1 10 Some random: 1621009549469.535
3 4 0.75 7 Some random: 1621009549470.077
2 2 1 4 Some random: 1621009549473.166
1 2 0.5 3 Some random: 1621009549474.536
12 12 1 24 Some random: 1621009549477.938
.1 .2 Expression: [(ROUND(.1 / .2,2))] could not be calculated, Unknown operator '.' at position 8 Expression: [(.1 + .2)] could not be calculated, Unknown operator '.' at position 2 Expression: [CONCAT("Some random: ", ((RANDOM() + .1 - .2 + NOW())))] could not be calculated, Unknown operator '.' at position 38
1 3 0.33 4 Some random: 1621009549479.187
1 2 0.5 3 Some random: 1621009549482.227
1 2 0.5 3 Some random: 1621009549484.302
34 56 0.61 90 Some random: 1621009549465.338
3 4 0.75 7 Some random: 1621009549488.532
1 1 1 2 Some random: 1621009549490.208
4 5 0.8 9 Some random: 1621009549491.899
56,56 54 56 Expression: [(56,56 + 54)] could not be calculated, Too many numbers or variables Some random: 56.18718301811098
1.1 4 0.28 5.1 Some random: 1621009549492.248
5 4 1.25 9 Some random: 1621009549499.540
15 30 0.5 45 Some random: 1621009549485.981
60 15 4 75 Some random: 1621009549547.158
1 2 0.5 3 Some random: 1621009549503.608
100 200 0.5 300 Some random: 1621009549406.585
2 33 0.06 35 Some random: 1621009549477.699
1 1 1 2 Some random: 1621009549510.745
100.10 100.10 1 200.2 Some random: 1621009549512.725
5 6 0.83 11 Some random: 1621009549513.269
15 45 0.33 60 Some random: 1621009549486.233
3 4 0.75 7 Some random: 1621009549517.053
2 3 0.67 5 Some random: 1621009549518.855
1 2 0.5 3 Some random: 1621009549521.089
3 7 0.43 10 Some random: 1621009549520.332
2 3 0.67 5 Some random: 1621009549525.973
100 200 0.5 300 Some random: 1621009549428.948
1 5 0.2 6 Some random: 1621009549526.999
4 5 0.8 9 Some random: 1621009549531.269
4 5 0.8 9 Some random: 1621009549532.958
123 234 0.53 357 Some random: 1621009549424.754
12 12 1 24 Some random: 1621009549537.691
3 4 0.75 7 Some random: 1621009549538.488
3 2 1.5 5 Some random: 1621009549541.918
11111 22222 0.5 33333 Some random: 1621009538431.353
1 2 0.5 3 Some random: 1621009549543.594
1 1 1 2 Some random: 1621009549545.144
10 10 1 20 Some random: 1621009549547.332
1 3 0.33 4 Some random: 1621009549547.494
0.2 0.2 1 0.4 Some random: 1621009549550.531
1 2 0.5 3 Some random: 1621009549551.680
1 4 0.25 5 Some random: 1621009549551.531
12 12 1 24 Some random: 1621009549556.044
10 10 1 20 Some random: 1621009549557.335
23 45 0.51 68 Some random: 1621009549537.563
1 2 0.5 3 Some random: 1621009549560.243
3 7 0.43 10 Some random: 1621009549558.262
5345345 534534 10 5879879 Some random: 1621014360375.881
43.54534 6545.456456 0.01 6589.001796 Some random: 1621009543063.392
1 1 1 2 Some random: 1621009549567.939
144 144 1 288 Some random: 1621009549569.444
114 114 1 228 Some random: 1621009549570.938
114 114 1 228 Some random: 1621009549572.942
114 114 1 228 Some random: 1621009549574.176
114 114 1 228 Some random: 1621009549575.984
114 114 1 228 Some random: 1621009549577.959
5 5 1 10 Some random: 1621009549579.232
4 4 1 8 Some random: 1621009549580.180
2 1 2 3 Some random: 1621009549583.818
1 2 0.5 3 Some random: 1621009549582.427
1 2 0.5 3 Some random: 1621009549584.864
1 2 0.5 3 Some random: 1621009549586.109
2 3 0.67 5 Some random: 1621009549587.707
1097 1079 1.02 2176 Some random: 1621009549608.669
58 2 29 60 Some random: 1621009549648.220
100 100 1 200 Some random: 1621009549594.058
1 1 1 2 Some random: 1621009549595.881
1 2 0.5 3 Some random: 1621009549596.085
56 87 0.64 143 Some random: 1621009549568.286
1 2 0.5 3 Some random: 1621009549600.628
1 1 1 2 Some random: 1621009549602.067
1 2 0.5 3 Some random: 1621009549603.628
2 3 0.67 5 Some random: 1621009549605.580
5 9 0.56 14 Some random: 1621009549604.037
3 3 1 6 Some random: 1621009549610.050
4 4 1 8 Some random: 1621009549612.951
1 2 0.5 3 Some random: 1621009549612.143
2 3 0.67 5 Some random: 1621009549614.132
3 4 0.75 7 Some random: 1621009549616.532
5000 5000 1 10000 Some random: 1621009549618.073
3 3 1 6 Some random: 1621009549620.931
12 13 0.92 25 Some random: 1621009549621.320
.5 .7 Expression: [(ROUND(.5 / .7,2))] could not be calculated, Unknown operator '.' at position 8 Expression: [(.5 + .7)] could not be calculated, Unknown operator '.' at position 2 Expression: [CONCAT("Some random: ", ((RANDOM() + .5 - .7 + NOW())))] could not be calculated, Unknown operator '.' at position 38
0.5 0.7 0.71 1.2 Some random: 1621009549625.962
1 1 1 2 Some random: 1621009549627.599
4 5 0.8 9 Some random: 1621009549628.225
69 420 0.16 489 Some random: 1621009549280.402
1 2 0.5 3 Some random: 1621009549632.366
2 4 0.5 6 Some random: 1621009549633.491
2 3 0.67 5 Some random: 1621009549635.986
3 4 0.75 7 Some random: 1621009549637.540
50 10 5 60 Some random: 1621009549680.726
0 0 0 0 Some random: 1621009549641.148
1 2 0.5 3 Some random: 1621009549642.453
3 7 0.43 10 Some random: 1621009549641.071
1 1 1 2 Some random: 1621009549646.496
11 2 5.5 13 Some random: 1621009549657.076
2 1 2 3 Some random: 1621009549651.656
33 22 1.5 55 Some random: 1621009549664.713
3 3 1 6 Some random: 1621009549655.024
5 5 1 10 Some random: 1621009549656.752
2 2 1 4 Some random: 1621009549658.931
4 5 0.8 9 Some random: 1621009549659.781
4 5 0.8 9 Some random: 1621009549660.736
8+9 12+2 10.75 31 Some random: 1621009549670.366
10.2352 15.2350 0.67 25.4702 Some random: 1621009549660.966
1 2 0.5 3 Some random: 1621009549665.358
10 15 0.67 25 Some random: 1621009549663.620
10 30 0.33 40 Some random: 1621009549671.026
8 9 0.89 17 Some random: 1621009549693.409
3 4 0.75 7 Some random: 1621009549695.068
5 6 0.83 11 Some random: 1621009549698.042
2 3 0.67 5 Some random: 1621009549700.638
4 4 1 8 Some random: 1621009549702.530
0.2 0.5 0.4 0.7 Some random: 1621009549704.659
1 2 0.5 3 Some random: 1621009549706.112



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