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

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: 1660381269645.911
8 9 0.89 17 Some random: 1660381269650.033
9 8 1.12 17 Some random: 1660381269652.364
.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: 1660381269662.313
1 2 0.5 3 Some random: 1660381269663.384
33 2 16.5 35 Some random: 1660381269695.983
1 32 0.03 33 Some random: 1660381269633.290
1 2 0.5 3 Some random: 1660381269664.845
1 2 0.5 3 Some random: 1660381269664.820
1 1 1 2 Some random: 1660381269665.829
4 1 4 5 Some random: 1660381269669.769
123 123 1 246 Some random: 1660381269666.023
2 2 1 4 Some random: 1660381269667.559
3 4 0.75 7 Some random: 1660381269666.574
3 4 0.75 7 Some random: 1660381269666.276
3 2 1.5 5 Some random: 1660381269669.662
33 32 1.03 65 Some random: 1660381269676.970
5 5 1 10 Some random: 1660381269676.703
3 4 0.75 7 Some random: 1660381269675.692
2 2 1 4 Some random: 1660381269676.571
1 2 0.5 3 Some random: 1660381269676.878
12 12 1 24 Some random: 1660381269677.911
.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: 1660381269676.432
1 2 0.5 3 Some random: 1660381269677.464
1 2 0.5 3 Some random: 1660381269677.114
34 56 0.61 90 Some random: 1660381269657.928
3 4 0.75 7 Some random: 1660381269678.482
1 1 1 2 Some random: 1660381269679.962
4 5 0.8 9 Some random: 1660381269679.396
56,56 54 56 Expression: [(56,56 + 54)] could not be calculated, Too many numbers or variables Some random: 56.50718491923257
1.1 4 0.28 5.1 Some random: 1660381269677.437
5 4 1.25 9 Some random: 1660381269682.240
15 30 0.5 45 Some random: 1660381269666.466
60 15 4 75 Some random: 1660381269727.895
1 2 0.5 3 Some random: 1660381269681.670
100 200 0.5 300 Some random: 1660381269582.787
2 33 0.06 35 Some random: 1660381269652.301
1 1 1 2 Some random: 1660381269683.115
100.10 100.10 1 200.2 Some random: 1660381269684.199
5 6 0.83 11 Some random: 1660381269683.082
15 45 0.33 60 Some random: 1660381269654.986
3 4 0.75 7 Some random: 1660381269684.231
2 3 0.67 5 Some random: 1660381269684.846
1 2 0.5 3 Some random: 1660381269685.624
3 7 0.43 10 Some random: 1660381269682.558
2 3 0.67 5 Some random: 1660381269686.915
100 200 0.5 300 Some random: 1660381269587.979
1 5 0.2 6 Some random: 1660381269684.322
4 5 0.8 9 Some random: 1660381269687.350
4 5 0.8 9 Some random: 1660381269687.119
123 234 0.53 357 Some random: 1660381269578.332
12 12 1 24 Some random: 1660381269689.028
3 4 0.75 7 Some random: 1660381269689.036
3 2 1.5 5 Some random: 1660381269691.908
11111 22222 0.5 33333 Some random: 1660381258579.078
1 2 0.5 3 Some random: 1660381269690.984
1 1 1 2 Some random: 1660381269691.846
10 10 1 20 Some random: 1660381269691.526
1 3 0.33 4 Some random: 1660381269690.398
0.2 0.2 1 0.4 Some random: 1660381269692.271
1 2 0.5 3 Some random: 1660381269691.188
1 4 0.25 5 Some random: 1660381269690.599
12 12 1 24 Some random: 1660381269693.799
10 10 1 20 Some random: 1660381269694.906
23 45 0.51 68 Some random: 1660381269672.217
1 2 0.5 3 Some random: 1660381269693.960
3 7 0.43 10 Some random: 1660381269691.391
5345345 534534 10 5879879 Some random: 1660386080506.117
43.54534 6545.456456 0.01 6589.001796 Some random: 1660381263194.821
1 1 1 2 Some random: 1660381269696.966
144 144 1 288 Some random: 1660381269703.316
114 114 1 228 Some random: 1660381269704.444
114 114 1 228 Some random: 1660381269705.142
114 114 1 228 Some random: 1660381269705.330
114 114 1 228 Some random: 1660381269705.508
114 114 1 228 Some random: 1660381269706.763
5 5 1 10 Some random: 1660381269706.160
4 4 1 8 Some random: 1660381269706.428
2 1 2 3 Some random: 1660381269708.022
1 2 0.5 3 Some random: 1660381269706.010
1 2 0.5 3 Some random: 1660381269706.288
1 2 0.5 3 Some random: 1660381269707.769
2 3 0.67 5 Some random: 1660381269707.247
1097 1079 1.02 2176 Some random: 1660381269726.375
58 2 29 60 Some random: 1660381269765.138
100 100 1 200 Some random: 1660381269709.801
1 1 1 2 Some random: 1660381269709.386
1 2 0.5 3 Some random: 1660381269709.015
56 87 0.64 143 Some random: 1660381269679.132
1 2 0.5 3 Some random: 1660381269709.528
1 1 1 2 Some random: 1660381269711.770
1 2 0.5 3 Some random: 1660381269710.865
2 3 0.67 5 Some random: 1660381269710.111
5 9 0.56 14 Some random: 1660381269708.456
3 3 1 6 Some random: 1660381269712.696
4 4 1 8 Some random: 1660381269712.967
1 2 0.5 3 Some random: 1660381269712.997
2 3 0.67 5 Some random: 1660381269712.260
3 4 0.75 7 Some random: 1660381269714.687
5000 5000 1 10000 Some random: 1660381269716.834
3 3 1 6 Some random: 1660381269716.684
12 13 0.92 25 Some random: 1660381269715.144
.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: 1660381269717.124
1 1 1 2 Some random: 1660381269717.788
4 5 0.8 9 Some random: 1660381269717.983
69 420 0.16 489 Some random: 1660381269367.325
1 2 0.5 3 Some random: 1660381269717.012
2 4 0.5 6 Some random: 1660381269717.829
2 3 0.67 5 Some random: 1660381269718.595
3 4 0.75 7 Some random: 1660381269718.225
50 10 5 60 Some random: 1660381269760.383
0 0 0 0 Some random: 1660381269722.619
1 2 0.5 3 Some random: 1660381269721.742
3 7 0.43 10 Some random: 1660381269719.936
1 1 1 2 Some random: 1660381269723.311
11 2 5.5 13 Some random: 1660381269733.326
2 1 2 3 Some random: 1660381269725.340
33 22 1.5 55 Some random: 1660381269735.271
3 3 1 6 Some random: 1660381269725.914
5 5 1 10 Some random: 1660381269725.651
2 2 1 4 Some random: 1660381269725.289
4 5 0.8 9 Some random: 1660381269725.262
4 5 0.8 9 Some random: 1660381269725.265
8+9 12+2 10.75 31 Some random: 1660381269734.111
10.2352 15.2350 0.67 25.4702 Some random: 1660381269722.779
1 2 0.5 3 Some random: 1660381269726.248
10 15 0.67 25 Some random: 1660381269723.966
10 30 0.33 40 Some random: 1660381269708.772
8 9 0.89 17 Some random: 1660381269727.285
3 4 0.75 7 Some random: 1660381269728.825
5 6 0.83 11 Some random: 1660381269728.185
2 3 0.67 5 Some random: 1660381269728.949
4 4 1 8 Some random: 1660381269730.270
0.2 0.5 0.4 0.7 Some random: 1660381269730.479
1 2 0.5 3 Some random: 1660381269730.223
100000 100000 1 200000 Some random: 1660381269731.059
1 1 1 2 Some random: 1660381269731.490
6 7 0.86 13 Some random: 1660381269731.798
10 2 5 12 Some random: 1660381269740.211
1 2 0.5 3 Some random: 1660381269733.720
1 2 0.5 3 Some random: 1660381269733.174
21 7 3 28 Some random: 1660381269748.186
1 2 0.5 3 Some random: 1660381269734.033
1 2 0.5 3 Some random: 1660381269734.403
999 998 1 1997 Some random: 1660381269736.321
17 3 5.67 20 Some random: 1660381269750.036
5 6 0.83 11 Some random: 1660381269735.207
5 4 1.25 9 Some random: 1660381269737.419
1 1 1 2 Some random: 1660381269737.766
25000 0,30 0 Expression: [(25000 + 0,30)] could not be calculated, Too many numbers or variables Some random: 25000.29322886209
5 8 0.62 13 Some random: 1660381269734.980
124 333 0.37 457 Some random: 1660381269529.803
5 1 5 6 Some random: 1660381269742.710
4 1223 0 1227 Some random: 1660381268520.960
2 3 0.67 5 Some random: 1660381269738.606
45 1908 0.02 1953 Some random: 1660381267876.689
3 3 1 6 Some random: 1660381269740.898
1 2 0.5 3 Some random: 1660381269739.219
5 5 1 10 Some random: 1660381269740.376
1 2 0.5 3 Some random: 1660381269739.114
1 2 0.5 3 Some random: 1660381269740.705
1.6 5 0.32 6.6 Some random: 1660381269738.224
4 5 0.8 9 Some random: 1660381269741.707
1 2 0.5 3 Some random: 1660381269741.792
2 3 0.67 5 Some random: 1660381269741.963
1 2 0.5 3 Some random: 1660381269742.619
1 0 0 1 Some random: 1660381269744.303
2 3 0.67 5 Some random: 1660381269742.283
10 1 10 11 Some random: 1660381269752.499
1 1 1 2 Some random: 1660381269744.563
1 4 0.25 5 Some random: 1660381269742.174
1 1 1 2 Some random: 1660381269745.180
7 2 3.5 9 Some random: 1660381269751.977
1 1 1 2 Some random: 1660381269746.109
351 357 0.98 708 Some random: 1660381269740.076
7,567,953,414 1000000 7 Expression: [(7,567,953,414 + 1000000)] could not be calculated, Too many numbers or variables Some random: 7.353806737636008
25 23 1.09 48 Some random: 1660381269749.839
5 9 0.56 14 Some random: 1660381269743.285
13213 123123213 0 123136426 Some random: 1660258159748.759
8 9 0.89 17 Some random: 1660381269747.073
4 3 1.33 7 Some random: 1660381269749.852
123 123 1 246 Some random: 1660381269749.840
10 5 2 15 Some random: 1660381269754.274
2 2 1 4 Some random: 1660381269749.789
4 4 1 8 Some random: 1660381269750.990
4 4 1 8 Some random: 1660381269750.486
12 12 1 24 Some random: 1660381269750.469
1 2 0.5 3 Some random: 1660381269750.714
2 3 0.67 5 Some random: 1660381269750.177
1 2 0.5 3 Some random: 1660381269750.447
1,5 1,2 1 Expression: [(1,5 + 1,2)] could not be calculated, Too many numbers or variables Some random: 1.692685770954791
5 5 1 10 Some random: 1660381269752.877
1 2 0.5 3 Some random: 1660381269751.718
2 2 1 4 Some random: 1660381269752.351
2 3 0.67 5 Some random: 1660381269752.723
10 5 2 15 Some random: 1660381269758.197
1 2 0.5 3 Some random: 1660381269752.064
1 2 0.5 3 Some random: 1660381269648.785
1 2 0.5 3 Some random: 1660381269649.422
0 1 0 1 Some random: 1660381269651.523
10 20 0.5 30 Some random: 1660381269642.531
54 34 1.59 88 Some random: 1660381269672.500
2 5 0.4 7 Some random: 1660381269650.811
1 2 0.5 3 Some random: 1660381269652.758
2 3 0.67 5 Some random: 1660381269652.491
3 4 0.75 7 Some random: 1660381269653.031
1 2 0.5 3 Some random: 1660381269653.442
12 9 1.33 21 Some random: 1660381269658.530
3 4 0.75 7 Some random: 1660381269654.291
100 200 0.5 300 Some random: 1660381269555.764
1000 3 333.33 1003 Some random: 1660381270653.384
10 5 2 15 Some random: 1660381269661.413
20 40 0.5 60 Some random: 1660381269636.347
0 101 0 101 Some random: 1660381269556.216
3 3 1 6 Some random: 1660381269657.413
1 2 0.5 3 Some random: 1660381269657.042
1 23 0.04 24 Some random: 1660381269636.991
20 30 0.67 50 Some random: 1660381269648.286
20 50 0.4 70 Some random: 1660381269629.584
5 2 2.5 7 Some random: 1660381269662.467
8 9 0.89 17 Some random: 1660381269659.521
7 7 1 14 Some random: 1660381269661.960
100 200 0.5 300 Some random: 1660381269561.189
3 3 1 6 Some random: 1660381269668.973
4 2 2 6 Some random: 1660381269671.428
10 20 0.5 30 Some random: 1660381269659.887
1 6 0.17 7 Some random: 1660381269664.227
1 1 1 2 Some random: 1660381269670.421
1 2 0.5 3 Some random: 1660381269669.503
1 2 0.5 3 Some random: 1660381269669.768
1 1 1 2 Some random: 1660381269671.378
0.2 1 0.2 1.2 Some random: 1660381269670.593
4 2 2 6 Some random: 1660381269674.082
3 3 1 6 Some random: 1660381269672.633
2 3 0.67 5 Some random: 1660381269671.364
1 1 1 2 Some random: 1660381269673.460
3 3 1 6 Some random: 1660381269673.096
22 5 4.4 27 Some random: 1660381269690.366
75 25 3 100 Some random: 1660381269724.511



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