• Resolved infocade

    (@infocade)


    Hello,
    I’d like to prevent some fields of my form from being stored. Or the other way around only a few fields should be stored.
    All fields should be sent in notifiers though.

    The option in the settings interface applies to all fields altogether afaik.

    Is that possible somehow?

    Thanks in advance!

    • This topic was modified 1 month ago by infocade.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    hello @infocade

    Hope you are doing well today.

    Forminator does have an option to disable database storage however it will not work for a specific field, when you disable it in the form setting, it will disable the storage for all fields.

    I’m afraid there are any out of box options that allow to prevent storage for specific fields.
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#data-storage

    Kind Regards
    Amin

    Thread Starter infocade

    (@infocade)

    Hello @wpmudev-support2 ,
    thanks for the swift reply!
    Yes, I see that the option available in the UI affects all data.

    I’m thinking about adding some PHP-code that can do this.
    Do you think that is possible?
    By which attribute could I get the fields? name or ID?

    Thank you!
    Michael

    • This reply was modified 1 month ago by infocade.
    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @infocade,

    I hope things are going well for you.

    You can prepare a custom PHP code with this hook forminator_custom_form_submit_before_set_fields that can help limit the field sent to the database.

    Furthermore, achieving your goal will require some custom development work, which is outside our support scope.

    For that, you’ll need to hire a developer. so they can provide the required custom code. WordPress provides a jobs directory here: https://jobs.wordpress.net/. If you need further advice about it, feel free to email [email protected].

    Subject: ATTN: WPMU DEV support - wp.org
    Topic URL :- https://www.ads-software.com/support/topic/prevent-some-fields-from-being-stored-into-database/

    Kind Regards,
    Imran Khan

    Thread Starter infocade

    (@infocade)

    Thank you, Imran @wpmudev-support9

    I consider, as a workaround, to disable the storing and store those form entry data that I need to store in a separate table that I set up on the side.

    However, it seems that the data are handled in an object not an array and are not accessible with the hook forminator_custom_form_submit_before_set_fields

    Can you share some information on that? Or would you recommend a different hook?
    Or do you think this isn’t possible whatsoever?

    Many thanks!

    Thread Starter infocade

    (@infocade)

    PS.: just to clarify

    “to disable the storing”

    refers to the UI-option of forminator

    “store those form entry data that I need to store in a separate table”

    This I want to achieve by some additional PHP-code

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @infocade

    That is correct but you should be able to use that hook to run your custom function on submit data. you can check the plugin files to find more information about that hook, here is some info:

    * Action called before setting fields to database
    * @param Forminator_Form_Entry_Model $entry - the entry model.
    * @param int $form_id - the form id.
    * @param array $field_data_array - the entry data.

    The hook is in library\modules\custom-forms\front\front-action.php:1048 file, I’m afraid I can’t share any examples since custom coding is out of scope of our support but you should be able to find more information by checking the mentioned file.

    Kind Regards
    Amin

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @infocade

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

    Kind Regards,
    Kris

    Thread Starter infocade

    (@infocade)

    Hi Kris,
    yes, the issue is solved! The information on the hook was helpful. Our custom script to insert form-data into a custom table is working now! ??
    Thank you so much!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.