berndbuchegger
Forum Replies Created
-
Hi @tahmidulkarim,
Ok figured out myself.
Basically the response contains the return values from the form in a nested array with your form fields fieldname as index.`array(12) {
[“__fluent_form_embded_post_id”]=> string(4) “4753”
[“_fluentform_9_fluentformnonce”]=> string(10) “a191ac4c97”
[“_wp_http_referer”]=> string(18) “/MYFORMURL/”
[“MYFIELD1”]=> string(6) “123456”
[“MYFIELD2”]=> string(6) “123456”
[“MYOPTIONS”]=> array(2)
{ [“MYOPTION1”]=> string(5) “12345”
[“MYOPTION2”]=> string(9) “123456789”} `Overall this solution approach works.
Obviously you cannot pass any parameters to the smartcode other then using hidden form fields.If followed the instructions on https://fluentforms.com/docs/creating-custom-smartcode-for-form-editor/ and I am now able to insert a smartcode into the PDF. 🙂
Note that this has to be a smartcode for the email/confirmation settings not the editor.
In the docs you provided an example to access the submussion data.
`$submittedData = \json_decode($entry->response, true);
but I am confused to to actually get to the form data within this submission data.
The docs about the submission_data is https://fluentforms.com/docs/submission_data-array/ very minimalCan you provide some examples how to access fields set in the submisson data?
I need to access the values of several dropdown lists.
Thanks in advance!After reading the manual I do not see how to pass any parameter to a smartcode.
Is that possible or am I stuck to what is provided through the $value or $form paramter in the function call?add_filter('fluentform_editor_shortcode_callback_my_own_smartcode', function ($value, $form)Ok thanks for the hint – will try your proposed approach!
Hi Tahmid,
Thank you very much for your solution proposal!Some more insights from my research so far:
* The PDF Generator supports Shortcodes. The plugin “Calculate Values with Shortcodes” can be used for simple scenarios –> https://www.wordpresspluginfinder.com/calculate-values-with-shortcodes/ – I tried it successfully but could then not combine [calculate] with nested [ff_if] conditionals. Which is essential for our use case.Another idea was to program your own shortcode, feed it with respective parameters and use the shortcode output in the PDF generator.
Anyway thanks for your swift support, mate!