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: 1614692385102.326
8 9 0.89 17 Some random: 1614692385106.326
9 8 1.12 17 Some random: 1614692385110.902
.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: 1614692385113.329
1 2 0.5 3 Some random: 1614692385114.426
33 2 16.5 35 Some random: 1614692385148.530
1 32 0.03 33 Some random: 1614692385088.598
1 2 0.5 3 Some random: 1614692385119.535
1 2 0.5 3 Some random: 1614692385121.247
1 1 1 2 Some random: 1614692385124.628
4 1 4 5 Some random: 1614692385133.149
123 123 1 246 Some random: 1614692385132.097
2 2 1 4 Some random: 1614692385134.179
3 4 0.75 7 Some random: 1614692385136.372
3 4 0.75 7 Some random: 1614692385137.864
3 2 1.5 5 Some random: 1614692385141.092
33 32 1.03 65 Some random: 1614692385143.531
5 5 1 10 Some random: 1614692385144.897
3 4 0.75 7 Some random: 1614692385145.396
2 2 1 4 Some random: 1614692385148.857
1 2 0.5 3 Some random: 1614692385148.627
12 12 1 24 Some random: 1614692385151.721
.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: 1614692385153.642
1 2 0.5 3 Some random: 1614692385156.576
1 2 0.5 3 Some random: 1614692385158.673
34 56 0.61 90 Some random: 1614692385138.570
3 4 0.75 7 Some random: 1614692385161.040
1 1 1 2 Some random: 1614692385164.315
4 5 0.8 9 Some random: 1614692385165.094
56,56 54 56 Expression: [(56,56 + 54)] could not be calculated, Too many numbers or variables Some random: 56.72281541184794
1.1 4 0.28 5.1 Some random: 1614692385166.689
5 4 1.25 9 Some random: 1614692385172.962
15 30 0.5 45 Some random: 1614692385158.315
60 15 4 75 Some random: 1614692385219.878
1 2 0.5 3 Some random: 1614692385175.338
100 200 0.5 300 Some random: 1614692385078.573
2 33 0.06 35 Some random: 1614692385148.752
1 1 1 2 Some random: 1614692385193.650
100.10 100.10 1 200.2 Some random: 1614692385195.531
5 6 0.83 11 Some random: 1614692385195.003
15 45 0.33 60 Some random: 1614692385168.142
3 4 0.75 7 Some random: 1614692385199.657
2 3 0.67 5 Some random: 1614692385201.082
1 2 0.5 3 Some random: 1614692385210.358
3 7 0.43 10 Some random: 1614692385209.175
2 3 0.67 5 Some random: 1614692385214.851
100 200 0.5 300 Some random: 1614692385117.553
1 5 0.2 6 Some random: 1614692385215.683
4 5 0.8 9 Some random: 1614692385220.822
4 5 0.8 9 Some random: 1614692385221.142
123 234 0.53 357 Some random: 1614692385113.360
12 12 1 24 Some random: 1614692385226.561
3 4 0.75 7 Some random: 1614692385227.673
3 2 1.5 5 Some random: 1614692385230.626
11111 22222 0.5 33333 Some random: 1614692374120.478
1 2 0.5 3 Some random: 1614692385232.732
1 1 1 2 Some random: 1614692385235.045
10 10 1 20 Some random: 1614692385236.700
1 3 0.33 4 Some random: 1614692385236.560
0.2 0.2 1 0.4 Some random: 1614692385240.640
1 2 0.5 3 Some random: 1614692385241.633
1 4 0.25 5 Some random: 1614692385240.132
12 12 1 24 Some random: 1614692385245.977
10 10 1 20 Some random: 1614692385247.857
23 45 0.51 68 Some random: 1614692385227.004
1 2 0.5 3 Some random: 1614692385249.744
3 7 0.43 10 Some random: 1614692385248.972
5345345 534534 10 5879879 Some random: 1614697196065.652
43.54534 6545.456456 0.01 6589.001796 Some random: 1614692378753.356
1 1 1 2 Some random: 1614692385257.663
144 144 1 288 Some random: 1614692385259.824
114 114 1 228 Some random: 1614692385261.596
114 114 1 228 Some random: 1614692385263.860
114 114 1 228 Some random: 1614692385264.280
114 114 1 228 Some random: 1614692385266.625
114 114 1 228 Some random: 1614692385268.974
5 5 1 10 Some random: 1614692385271.500
4 4 1 8 Some random: 1614692385274.903
2 1 2 3 Some random: 1614692385278.044
1 2 0.5 3 Some random: 1614692385279.964
1 2 0.5 3 Some random: 1614692385281.012
1 2 0.5 3 Some random: 1614692385283.829
2 3 0.67 5 Some random: 1614692385285.248
1097 1079 1.02 2176 Some random: 1614692385306.975
58 2 29 60 Some random: 1614692385346.899
100 100 1 200 Some random: 1614692385292.004
1 1 1 2 Some random: 1614692385294.955
1 2 0.5 3 Some random: 1614692385295.294
56 87 0.64 143 Some random: 1614692385267.257
1 2 0.5 3 Some random: 1614692385299.684
1 1 1 2 Some random: 1614692385302.462
1 2 0.5 3 Some random: 1614692385302.190
2 3 0.67 5 Some random: 1614692385304.875
5 9 0.56 14 Some random: 1614692385303.580
3 3 1 6 Some random: 1614692385309.365
4 4 1 8 Some random: 1614692385311.935
1 2 0.5 3 Some random: 1614692385311.125
2 3 0.67 5 Some random: 1614692385313.727
3 4 0.75 7 Some random: 1614692385315.606
5000 5000 1 10000 Some random: 1614692385317.771
3 3 1 6 Some random: 1614692385319.561
12 13 0.92 25 Some random: 1614692385320.969
.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: 1614692385325.229
1 1 1 2 Some random: 1614692385327.719
4 5 0.8 9 Some random: 1614692385327.982
69 420 0.16 489 Some random: 1614692384979.285



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