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: 1722074421688.699
1 2 0.5 3 Some random: 1722074421705.848
1 1 1 2 Some random: 1722074421723.223
1 2 0.5 3 Some random: 1722074421739.056
4 4 1 8 Some random: 1722074421757.475
4 4 1 8 Some random: 1722074421774.989
7 8 0.88 15 Some random: 1722074421787.048
1 2 0.5 3 Some random: 1722074421802.349
8 9 0.89 17 Some random: 1722074421820.600
4 5 0.8 9 Some random: 1722074421844.839
100 1 100 101 Some random: 1722074421963.988
100 1 100 101 Some random: 1722074421980.875
2 3 0.67 5 Some random: 1722074421899.098
1 1 1 2 Some random: 1722074421936.865
1 2 0.5 3 Some random: 1722074421990.791
10 10 1 20 Some random: 1722074422036.992
1 2 0.5 3 Some random: 1722074422073.490
1 1 1 2 Some random: 1722074422106.629
100 50 2 150 Some random: 1722074422179.631
1 2 0.5 3 Some random: 1722074422145.018
11 13 0.85 24 Some random: 1722074422164.795
23 44 0.52 67 Some random: 1722074422161.262
1 2 0.5 3 Some random: 1722074422196.248
1 3 0.33 4 Some random: 1722074422225.153
5 5 1 10 Some random: 1722074422249.838
20 20 1 40 Some random: 1722074422269.509
1 1 1 2 Some random: 1722074422287.349
1 2 0.5 3 Some random: 1722074422304.918
1 3 0.33 4 Some random: 1722074422320.051
1 2 0.5 3 Some random: 1722074422339.690
5 5 1 10 Some random: 1722074422357.166
10 2 5 12 Some random: 1722074422382.259
2 2 1 4 Some random: 1722074422392.476
5 4 1.25 9 Some random: 1722074422410.609
3 2 1.5 5 Some random: 1722074422426.343
1 2 0.5 3 Some random: 1722074422437.951
2 2 1 4 Some random: 1722074422454.832
5 5 1 10 Some random: 1722074422469.032
3 3 1 6 Some random: 1722074422480.612
22 100 0.22 122 Some random: 1722074422417.894
3 3 1 6 Some random: 1722074422514.294
1 2 0.5 3 Some random: 1722074422534.881
1 1 1 2 Some random: 1722074422551.283
1 0 0 1 Some random: 1722074422570.202
1 2 0.5 3 Some random: 1722074422576.124
1 1 1 2 Some random: 1722074422582.666
33 33 1 66 Some random: 1722074422601.198
545 556 0.98 1101 Some random: 1722074422619.757
545 556 0.98 1101 Some random: 1722074422634.415
3 6 0.5 9 Some random: 1722074422655.044
1 2 0.5 3 Some random: 1722074422665.666
20 10 2 30 Some random: 1722074422695.006
12 12 1 24 Some random: 1722074422700.949
7 5 1.4 12 Some random: 1722074422720.564
11 14 0.79 25 Some random: 1722074422733.842
1 2 0.5 3 Some random: 1722074422752.354
2 2 1 4 Some random: 1722074422766.677
1 2 0.5 3 Some random: 1722074422781.833
24 1 24 25 Some random: 1722074422818.180
13 13 1 26 Some random: 1722074422808.479
100 10 10 110 Some random: 1722074422910.331
2 2 1 4 Some random: 1722074422834.347
5 0 0 5 Some random: 1722074422850.851
0 1 0 1 Some random: 1722074422859.211
5 5 1 10 Some random: 1722074422874.505
2 2 1 4 Some random: 1722074422889.174
-2 2 -1 0 Some random: 1722074422897.504
8 9 0.89 17 Some random: 1722074422904.441
15 1 15 16 Some random: 1722074422925.903
1 1 1 2 Some random: 1722074422926.548
1 1 1 2 Some random: 1722074422929.332
1 1 1 2 Some random: 1722074422931.673
1 2 0.5 3 Some random: 1722074422937.500
45 5 9 50 Some random: 1722074422988.151
2 2 1 4 Some random: 1722074422958.157
2 2 1 4 Some random: 1722074422969.411
5 10 0.5 15 Some random: 1722074422970.131
3 2 1.5 5 Some random: 1722074422986.560
11 13 0.85 24 Some random: 1722074422994.212
22 22 1 44 Some random: 1722074423010.587
2 2 1 4 Some random: 1722074423024.334
1 2 0.5 3 Some random: 1722074423030.871
5 5 1 10 Some random: 1722074423037.310
6 125 0.05 131 Some random: 1722074422930.607
23 32312 0 32335 Some random: 1722074390768.341
1 1 1 2 Some random: 1722074423071.009
1 2 0.5 3 Some random: 1722074423081.378
2 2 1 4 Some random: 1722074423097.408
100 200 0.5 300 Some random: 1722074423018.785
2 2 1 4 Some random: 1722074423159.596
3 5 0.6 8 Some random: 1722074423175.695
3 4 0.75 7 Some random: 1722074423186.120
1 2 0.5 3 Some random: 1722074423214.023
1 2 0.5 3 Some random: 1722074423229.547
5 8 0.62 13 Some random: 1722074423244.706
3 8 0.38 11 Some random: 1722074423259.545
1 1 1 2 Some random: 1722074423275.985
5 3 1.67 8 Some random: 1722074423282.751
10 5 2 15 Some random: 1722074423286.019
1 2 0.5 3 Some random: 1722074423281.689
2 2 1 4 Some random: 1722074423283.108
2 123 0.02 125 Some random: 1722074423164.293
480 60 8 540 Some random: 1722074423709.010
300 20 15 320 Some random: 1722074423584.991
123 321 0.38 444 Some random: 1722074423115.216
6 509 0.01 515 Some random: 1722074422821.678
10 5 2 15 Some random: 1722074423346.506
([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: 1722074423286.758
3 4 0.75 7 Some random: 1722074423400.183
1 2 0.5 3 Some random: 1722074423423.425
3 3 1 6 Some random: 1722074423439.162
2 5 0.4 7 Some random: 1722074423452.528
25.00 25.00 1 50 Some random: 1722074423466.840
555 666 0.83 1221 Some random: 1722074423372.238
2 4 0.5 6 Some random: 1722074423495.484
2 3 0.67 5 Some random: 1722074423512.729
2 4 0.5 6 Some random: 1722074423530.844
1 1 1 2 Some random: 1722074423551.640
7,8 3,6 7 Expression: [(7,8 + 3,6)] could not be calculated, Too many numbers or variables Some random: 7.92669986947964251722074423570
55 40 1.38 95 Some random: 1722074423603.080
2 8 0.25 10 Some random: 1722074423588.196
3 4 0.75 7 Some random: 1722074423598.639
1 2 0.5 3 Some random: 1722074423604.145
3 4 0.75 7 Some random: 1722074423620.600
1 2 0.5 3 Some random: 1722074423638.651
20 10 2 30 Some random: 1722074423667.492
3 4 0.75 7 Some random: 1722074423670.250
4 5 0.8 9 Some random: 1722074423685.993
5 4 1.25 9 Some random: 1722074423708.537
1 1 1 2 Some random: 1722074423716.089
1 2 0.5 3 Some random: 1722074423728.886
5 5 1 10 Some random: 1722074423740.409



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