PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Editing / Updating Field value AFTER Submission

  1. I'm trying to modify a field value AFTER the entry has been saved.

    The scenario is - a user signs up to enter a competition.
    The user is thanked.
    The user is then offered the ability to post the page to twitter and gain an extra 'entry' (at which point I would hope to modify a field value on their entry to 'tweeted=yes' etc.

    I've noticed you've introduced entry meta in 1.6, but this doesn't seem to be exposed in the admin (entry list), and it doesn't look as though it appears in the exported data either.

    I've trawled the documentation and the forums but can't seem to find out how to do this.

    Posted 11 years ago on Wednesday September 21, 2011 | Permalink
  2. Are you wanting to modify the field value after a form has been submitted and the form processing is completely finished? If so there aren't going to be any hooks for that. Once the form processing is complete, there is nothing to hook into.

    If you want to modify the field value AFTER the entry has been saved but before form processing is complete you can use one of two hooks depending on what version of Gravity Forms you are running.

    Gravity Forms v1.6 (beta) and up:

    Gravity Forms v1.5.2.8 and below:

    These hooks fire after the entry has been created and notifications, etc. have been sent. They are basically the last hooks to be triggered as part of the form process.

    You would add a hidden field to your form to contain the tweeted value. You would then use one of the hooks above to update that value of that field based on code you execute. The field has to exist in some capacity on the form in order for it to exist as a field you can update.

    Technically you could use the new entry meta, but we don't have any documentation for it yet and it's primarily for internal development right now. It isn't automatically exposed in the admin. You would have to use admin hooks to display it's value.

    If you are wanting to update a field value AFTER the form process is completely over then that is an entirely different thing. You'd have to update the form data directly in the database.

    Posted 11 years ago on Wednesday September 21, 2011 | Permalink
  3. sascha

    Hey Carl,
    has the name of the hook just changed from 1.5 to 1.6? Or is it a different hook?

    Posted 11 years ago on Tuesday September 27, 2011 | Permalink
  4. It's a different hook and it is the one we recommend using in 1.6+ because we are deprecating gform_post_submission. It won't be removed right now, but may be in the future once a significant amount of time has passed.

    Posted 11 years ago on Tuesday September 27, 2011 | Permalink

This topic has been resolved and has been closed to new replies.