• Resolved filak18

    (@filak18)


    Hello,
    Forminator plugin is great.

    Though I need to generate a field with initial integer value and increment (+1) this value after each successful submission. And I need to use this field in email template.

    I have been struggling with this for some time but with no success…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @filak18

    I hope you’re well today!

    Currently it’s not possible out of the box as Forminator doesn’t create submission IDs on its own. A standard submission ID is just a standard DB auto-increment value and there’s no built-in “counter” like this in plugin code.

    It might, however, be possible with a bit of customization. This code was built for slightly different purpose but should do just that: create such auto-incremented and consecutive custom submission IDs for selected forms:

    https://gist.github.com/wpmudev-sls/b607c860225b0b6bde502bcdec0184fa

    You would need to specify forms to include (so it only would be applied to those forms) or to exclude (so it would be applied to all forms except those excluded) by their IDs and the starting value in this part of the code:

    private $include_form_ids = [];
    private $exclude_form_ids = [];//enter list exclude form ids, e.g: [234,456]
    private $start_number = 1;

    It should then store the numbers in “wpmudev_fm_custom_submission_id” option for the form.

    Please check it and let me know if it suits your needs and if so, we’ll look into how to include that generated number into e-mail notification as well.

    Best regards,
    Adam

    Thread Starter filak18

    (@filak18)

    Hi Adam,

    I am aware of the scripts at https://gist.github.com/wpmudev-sls

    I have tried several ones and some kinda work – but I need to use the final value in the email body – and this is where it all fails so far.

    The closest one to my needs is https://www.ads-software.com/support/topic/sequential-numbering-form-submission/

    As I had reported before:

    “This snippet works… But when I use the hidden field slug {hidden-1} in ie email subject or email body – all I get is “AUTOINCREMENT_INT”. The only way to output the right value is using {all_fields} – which is unhandy.

    So an incremental field type would be great to have – if it plays nicely in other places like email notifications or calculations etc…”

    Best regards
    Filip

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @filak18 ,

    So an incremental field type would be great to have – if it plays nicely in other places like email notifications or calculations etc…”

    We will suggest this to Forminator Team so they could consider adding this in the future.

    kind regards,
    Kasia

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @filak18

    I hope you are doing well and safe!

    We haven’t heard from you in a while, I’ll mark this thread as resolved.

    Feel free to let us know if you have any additional question or problem.

    Best Regards
    Patrick Freitas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Autoincrement field type with customizable initial value’ is closed to new replies.