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.

Gravity Form updates existing custom_ field value

  1. kinetic
    Member

    I am needing to build a status update tool for a local facility. For instance, in the event of inclement weather, someone can go to the site, set the status to closed and it will render on the live site.

    My initial thought for doing this was having a Gravity Form post to a custom post type with the values i needed in custom fields (open, closed, duration, etc). But that would mean each time they update the status, it would be creating a new post.

    Is there a better way to handle this that I am not seeing? Can I have the form always interact with a single post, or update a custom field value independent of a post?

    Posted 12 years ago on Thursday October 20, 2011 | Permalink
  2. Sounds like the post or page will already exist, and you just need to update the status on that page?

    Gravity Forms might be overkill for that application, but you can still do it. You would not want to create a post at all, just collect the status change. If there are multiple facilities to manage, then you will need to account for updating multiple posts. How many facilities do you need to maintain the status for? If it's just one, it will not be too bad. The process would be:

    • Know what post you're going to update
    • Know the custom field key and possible values
    • Use those values in a Gravity Form (radio buttons maybe, since the status is probably exclusive)
    • Embed that form into a page that can be accessed only by someone with proper rights
    • Process the form submission
    • Use the gform_post_submission hook with a function to update the meta value for one specific post

    It's doable, and not difficult, just a few pieces that need to be put together to make it work. If you can post more actual details about your situation, we can help point you in the right direction.

    Posted 12 years ago on Friday October 21, 2011 | Permalink