Performing Calculations

9 December, 2018 18:59:20
jstraete
Topics: 34
Messages: 111
Is there any syntax to perform calculations with the data? For instance, if I have a Formidable Form with a field ID [100] which contains a number, is there a way to insert into the PDF something like [100]*.02 to return the value of whatever [100]*.02 equals?
9 December, 2018 22:33:20
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

Unfortunately there is no direct support for calculations in E2Pdf at this moment. We have this point in our TODO list, so this feature will be released in future.

At this moment you can check Formidable Forms Field Calculation.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
10 December, 2018 09:11:39
jstraete
Topics: 34
Messages: 111
Ok no problem. I can use Formidable Forms field calculations, I was just trying to prevent adding another field to my form for the sole purpose of doing a calculation for the PDF.

Is there any syntax for doing if statements? I know I can use Actions to show/hide content, but I have a few text and text area fields where I would like to do something like this:
[100] = Make / Model Sold
[101] = Sell Description
[102] = Sell Price

Text area field =
[100:1]
[101:1]
Sell Price: $[102:1]

[100:2]
[101:2]
Sell Price: $[102:2]

I have all this information in the same text area field, because the length of the Sell Description can vary in length (may take up only one line, may take up 10 lines), so if I have them in the same text area field, the 2nd unit will always be placed directly below the first unit. However, there are times where there may only be 1 unit sold, in which case [100:2], [101:2], and [102:2] would all be blank, which is fine, but I would also want the text "Sell Price: $" to be blank in that instance also. So is there any syntax to add something to it like this to it so it will be blank in that scenario:

[if 102:2 != ""]Sell Price: $[/if 102:2][102:2]
10 December, 2018 09:53:55
E2Pdf
Support
Topics: 7
Messages: 3163
Unfortunately Formidable Forms do not offer Conditional Logic for separated Repeatable entries by default so such syntax will not work but you can try to use our "Actions" and "Conditions" to change dynamically output value:

The logic will look like:
If 100:1 != "" and 100:2 == "" we output one "Value".
If 100:1 != "" and 100:2 != "" and 100:3 == "" we output another "Value".

I attached screenshot with example from which it must be clear how to use it.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
10 December, 2018 10:16:12
jstraete
Topics: 34
Messages: 111
Ok yeah that's fine I can do it that way, I just got room on my template for potentially a dozen different entries from a repeatable field, so the Action statement is just going to be very big. Not a big deal that kind of syntax isn't possible, I just wanted to verify before starting in on a long Action statement. Thanks!