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.

Parsing GF data into separate cells on external report...

  1. I'm working on a website for a client and have very little experience with GF. They are wanting to use the reports from Cart66 to display who has filled out a form, what the entries are, and who has paid. Everything is working fine, with the exception of all of the GF info being imported into a single cell in the report called "Form Data". Is there any way to parse that out into separate cells with specific data that I want pulled from the form? I don't need all the cells from the form to pull into the report. Here is the current code that is working for that section.

    $orderColHeaders = implode(',', $orderHeaders);
        $orderColSql = implode(',', array_keys($orderHeaders));
        $out  = $orderColHeaders . ",Form Data,Item Number,Description,Quantity,Total\n";
    
        $sql = "SELECT $orderColSql from $orders where ordered_on >= %s AND ordered_on < %s order by ordered_on";
        $sql = $wpdb->prepare($sql, $start, $end);
        Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] SQL: $sql");
        $selectedOrders = $wpdb->get_results($sql, ARRAY_A);
    
        foreach($selectedOrders as $o) {
          $itemRowPrefix = '"' . $o['id'] . '","' . $o['trans_id'] . '",' . str_repeat(',', count($o)-3);
          $orderId = $o['id'];
          $sql = "SELECT form_entry_ids, item_number, description, quantity, product_price FROM $items where order_id = $orderId";

    Thanks!

    Posted 12 years ago on Sunday July 29, 2012 | Permalink
  2. Sounds like you need to talk with Cart 66 about how they store the data. Or, you might be able to work your SQL magic combining Cart 66 and Gravity Forms, with a JOIN on the entry ID (looks like they reference it as form_entry_ids.)

    This is an issue with Cart 66 and SQL and not with Gravity Forms.

    Posted 12 years ago on Monday July 30, 2012 | Permalink
  3. See I thought that at first too...but being that everything is being pulled correctly from Gravity Forms, I thought there would be a way to instead of calling "form_entry_ids" and that returning all of the form data, I could instead call specific ids from the form itself and have it parsed into separate cells.

    Forgive my limited knowledge on SQL.

    Posted 12 years ago on Monday July 30, 2012 | Permalink