Inserting shortcode in a Formidable Forms View to display repeater field data

Formidable Forms
17 September, 2020 11:23:28
seehowsupport
Topics: 1
Messages: 2
We have a number of FF Views that display student data which is contained in Repeater fields, using [foreach].

I have an E2PDF template to display a certificate for each student. I've tried inserting several different versions of the E2PDF shortcode (view, download, etc.) into the View, but nothing gets generated when I display the View.

What I would like is a link that allows the instructor to view/save/print a student's certificate.

So there's the question of how to use E2PDF shortcodes within a View.

And then there's the question of how to use Repeater fields within an E2PDF template. In your documentation, you say:

[field_id:num] - Repeatable fields separate values
field_id: (string)
num: (int)
Usage: [123:1]

But it's not clear what this means. Are we supposed to put in separate shortcodes, like [123:1] [123:2] [123:3] etc? But of course we can't know how many values there will be for an particular instance... so should we just use [123]?
17 September, 2020 12:21:58
E2Pdf
Support
Topics: 7
Messages: 3345
Hi,

To use "e2pdf" shortcode inside view it must be defined dataset as [id]. For example: [e2pdf-download id="1" dataset="[id]"]. So if you have view for multiple entries and you iterate over each entry you can put [e2pdf-download id="1" dataset="[id]"] inside "foreach" loop.

Regarding repeater fields, yes, it's working like this. Empty values will be truncated, however you can also use "foreach" loop inside "html" element same way as inside view but you must keep in mind that if data will be bigger than createed "html" block, it must be used 2nd page with "Splitting content over pages" feature as in example: https://www.youtube.com/watch?v=SZNxz_JZ3d0.

P.S. If you will decide to use "HTML" block with "foreach" loop it's recommended to "Disable WYSIWYG Editor" (screenshot attached).

We remain at your service.
We would really appreciate your feedback at WordPress.org!
21 September, 2020 18:21:24
seehowsupport
Topics: 1
Messages: 2
Thanks so much - the use of dataset in the shortcode was exactly what we needed.

And to also answer one of my questions - what works in the E2PDF template is just the shortcode for the field, as in [123] and not the version [123:1] that I asked about.

Thanks again!

GP