Search code examples
gravity-forms-plugingravityforms

Gravity Forms - Setting Entry ID as hidden field of current form


I am tying to use this filter to update an existing entry:

However, in the documentation it says:

  • This assumes that the entry ID to be updated has been submitted with the form from an input which as the input name "my_update_entry_id".

For my scenario it would be ideal if I could capture the Entry ID as part of the entry submission (in a hidden field). Is there a way to do this?

Alternatively, I could dynamically assign an entry ID prior to it being created?


Solution

  • If you are updating an entry, I'm assuming it already exists. If it already exists, you should be able to use dynamic population to populate the existing entry ID into a Hidden field on the form. Then you can use the example from the gform_entry_id_pre_save_lead documentation to update the desired entry on submission.

    Here's an existing snippet that does the same thing: https://gist.github.com/spivurno/32e914d67723f89717be2904ce6234c4