Convert Values

Forminator Forms Bug Released
14 January, 2025 13:46:41
recuniforms
Topics: 4
Messages: 21
Is it possible for users to input values into a form, but then display something different in the PDF? The conversion will be 1-to-1. So, for example, the user may select: Tiro Pants, but the PDF displays: SKU 7090.
14 January, 2025 23:19:29
E2Pdf
Support
Topics: 7
Messages: 3377
Hello,

The easiest way is to use the [e2pdf-format-output] shortcode with the "search" and "replace" attributes.

[e2pdf-format-output search="val1" replace="SKU 7090"]{textarea-1}[/e2pdf-format-output]

Or multiple values can be replaced by using the ||| separator as:

[e2pdf-format-output search="val1|||val2" replace="SKU 7090|||SKU 7091"]{textarea-1}[/e2pdf-format-output]
We would really appreciate your feedback at WordPress.org!
15 January, 2025 04:28:28
recuniforms
Topics: 4
Messages: 21
Thank you!
15 January, 2025 19:15:47
recuniforms
Topics: 4
Messages: 21
A related question: is it possible to call on the label of an input rather than the value? I’d like the output to be the label in one cell and the value in another on the same page.
16 January, 2025 00:01:10
E2Pdf
Support
Topics: 7
Messages: 3377
Unfortunately, Forminator doesn't include modifiers to output values or labels separately. However, you can use the [e2pdf-format-output] with its search-and-replace functionality to replace labels with values as an alternative.
We would really appreciate your feedback at WordPress.org!
16 January, 2025 15:03:53
recuniforms
Topics: 4
Messages: 21
Thank you for your responsiveness. Is it possible to use if statements to use one conversion given a condition and a different condition given a different condition. Here's what I tried:

[e2pdf-format-output
search="Youth XS|||Youth S|||Youth M|||Youth L|||Youth XL|||Adult S|||Adult M|||Adult L|||Adult XL|||Adult 2XL"
replace="{if select-6:1 in ['6001','6006','6007','6010','6011','6012','L025','L036','L040','L043','L044','L045','L049','L051','L052','L056','L059','L060','L062','L066','L067','L1023','L1024','Z108','Z109','Z110','Z111','Z112','Z114','Z115','Z116']}
4XS|||3XS|||2XS|||XS|||S|||L|||2XL|||3XL|||4XL|||5XL
{else}
NOT AVAILABLE|||5XS|||4XS|||3XS|||2XS|||S|||L|||XL|||2XL|||NOT AVAILABLE
{/if}"
]{select-11:1}[/e2pdf-format-output]

Each conversion works well, but it's returning both the if and else outputs.
16 January, 2025 15:26:44
E2Pdf
Support
Topics: 7
Messages: 3377
Unfortunately, no, it would not work in that example. Instead, it should be possible to use the [e2pdf-if] shortcode.

Example: https://codefile.io/f/vAJCky2niy


We would really appreciate your feedback at WordPress.org!
17 January, 2025 13:09:44
recuniforms
Topics: 4
Messages: 21
I appreciate your help with this! Here is how I'm using it:

<td width="50">[e2pdf-if][e2pdf-if-condition]{select-6}[in_array]a:31:{i:0;s:4:"6001";i:1;s:4:"6006";i:2;s:4:"6007";i:3;s:4:"6010";i:4;s:4:"6011";i:5;s:4:"6012";i:6;s:4:"L025";i:7;s:4:"L036";i:8;s:4:"L040";i:9;s:4:"L043";i:10;s:4:"L044";i:11;s:4:"L045";i:12;s:4:"L049";i:13;s:4:"L051";i:14;s:4:"L052";i:15;s:4:"L056";i:16;s:4:"L059";i:17;s:4:"L060";i:18;s:4:"L062";i:19;s:4:"L066";i:20;s:4:"L067";i:21;s:5:"L1023";i:22;s:5:"L1024";i:23;s:4:"Z108";i:24;s:4:"Z109";i:25;s:4:"Z110";i:26;s:4:"Z111";i:27;s:4:"Z112";i:28;s:4:"Z114";i:29;s:4:"Z115";i:30;s:4:"Z116";}[/e2pdf-if-condition][e2pdf-if-do][e2pdf-format-output search="Youth XS|||Youth S|||Youth M|||Youth L|||Youth XL|||Adult S|||Adult M|||Adult L|||Adult XL|||Adult 2XL" replace="4XS|||3XS|||2XS|||XS|||S|||L|||2XL|||3XL|||4XL|||5XL"]{select-15}[/e2pdf-format-output][/e2pdf-if-do][e2pdf-if-else][e2pdf-format-output search="Youth XS|||Youth S|||Youth M|||Youth L|||Youth XL|||Adult S|||Adult M|||Adult L|||Adult XL|||Adult 2XL" replace="NOT AVAILABLE|||5XS|||4XS|||3XS|||2XS|||S|||L|||XL|||2XL|||NOT AVAILABLE"]{select-15}[/e2pdf-format-output][/e2pdf-if-else][/e2pdf-if]</td>

<td width="70">{select-15}</td>

My challenge now is that the second td is looping and acts as it should (so {select-15:1} displays on the first page, {select-15:2} displays on the second page, etc., but ...

The first td is running the conversion as it should, but it's evaluating {select-15:1} on every page and therefore not outputting the correct value on page 2 and beyond. Is there a way to make it so the loop applies to the first td?
17 January, 2025 13:59:48
E2Pdf
Support
Topics: 7
Messages: 3377
We were able to replicate the issue on our side. Our team is currently investigating it, and we will let you know as soon as we have an update. Unfortunately, due to the weekend, it may take until Tuesday / Wednesday to resolve the issue. We apologize for the inconvenience.
We would really appreciate your feedback at WordPress.org!
20 January, 2025 01:37:54
E2Pdf
Support
Topics: 7
Messages: 3377
Hello,

We have released an update to the RC version 1.27.05, which should resolve the described issue. You can follow the steps outlined here to update: https://e2pdf.com/docs/install#rc-version.

Please let us know if you encounter any issues.
We would really appreciate your feedback at WordPress.org!