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.

raw data from Form entry object

  1. I am working on a plugin that will take a form submission and create a task in Asana via their API. I currently have a working model, but it doesn't get the entire data set, just the items from the get_grid_columns function.

    is there a straightforward way to get each field => value pair in a single array that I can then manipulate? not the entire form (which includes form IDs, etc) but just the actual entry fields, which all have a numeric key in the object. I'd prefer no HTML, since Asana can't take HTML, but I'll work with it if that's all I can get.

    FWIW, I'm using the gform_entry_created hook, but I have no issue using another hook / filter if that will give me what I need.

    Posted 11 years ago on Friday June 14, 2013 | Permalink
  2. Hey Andrew,

    Not exactly. The $entry object will get you most of the way there with an 'input_id' => 'value' pair for every submitted value on the form (including a few non-field based items as well).

    If you need to get the $field object for each of these values, you'll want to loop through the $form object's (which is the second parameter passed in the gform_entry_created hook) 'fields' property and find each field based on the input_id provided in the $entry object.

    Psuedo-code: http://snippi.com/s/uhgrmk5

    Edit: Forgot to mention, this will get you the "top level" field. If you're working with checkbox fields, this just gets you the field that contains those options. If you need the individual "input" settings, you'll want to drill down into the "inputs" property for for that specific field (i.e. $field['inputs']).

    Posted 11 years ago on Friday June 14, 2013 | Permalink
  3. Golden. That got me most of the way there. Since I only cared about fields that actually had data, this is how I got it: https://gist.github.com/norcross/5786457

    Posted 11 years ago on Saturday June 15, 2013 | Permalink
  4. Good stuff! Thanks for sharing the finished product. :)

    Posted 11 years ago on Saturday June 15, 2013 | Permalink