• Resolved just_mike70

    (@just_mike70)


    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

    https://www.ads-software.com/extend/plugins/exports-and-reports/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    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:

    https://www.ads-software.com/support/topic/meta-data-in-excel?replies=7#post-3925614

    Thread Starter just_mike70

    (@just_mike70)

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User Defined Fields’ is closed to new replies.