WordPress.org

Ready to get started?Download WordPress

Forums

Exports and Reports
[resolved] User Defined Fields (3 posts)

  1. just_mike70
    Member
    Posted 1 year ago #

    I downloaded the plugin today, and find it to be a really great tool.

    I've been able to create a couple of reports and CVS exports, but I can't seem to get the add fields.

    I have a table, created by the theme author that reuses a field called element_value several times. I have name, address, city, state and zip going into those fields. The author uses a field called element_label to sort of index element_value, so it would look like this:

    element_label element_value
    John Doe 1
    123 Main St 2
    Springfield 3
    IL 4
    60609 5

    There are 21 of these fields.

    I want to create mailing labels by exporting the data into a CVS, but as you can see, the above layout would take quite a bit of manipulation.

    What I was hoping to do was to add a fields called Name, Address, City, ST and ZIP to be formatted horizontally in columns instead of rows, as the table is defined.

    I don't know enough at this point to get the "add field" set-up. I was able to set up a field called Name, but I can't figure out how to use the rest of fields in the add field form to define it.

    I know I wrote a lot, but if there is any chance someone can assist me, I needed to give you all a lot of detail.

    Thanks,

    Mike

    http://wordpress.org/extend/plugins/exports-and-reports/

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    You'll need to do a separate JOIN for each field you want to include in the report in that kind of format.

    For an example, look at how this guy did his LEFT JOIN and added the select alias to the query:

    http://wordpress.org/support/topic/meta-data-in-excel?replies=7#post-3925614

  3. just_mike70
    Member
    Posted 1 year ago #

    I thought I would let you all see how I solved this. I used a group_concat which reads multiple rows into one one long string field row until the group_id field changes value. It also separates fields with a comma for my excel import, and lastly I entered the label for the field as "name,address,city,state,zip" (without the quotes) which then allows me to import the first row as column labels. It all works well.

    Thanks to Scott and others who made suggestions.

    Mike

    SELECT GROUP_CONCAT(element_value) as Name
    FROM wp_formmaker_submits GROUP BY group_id

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags