Support

Home Forums Event Espresso Premium List attendees with aneser to custom questions

List attendees with aneser to custom questions

Posted: August 20, 2015 at 11:48 am

Viewing 4 reply threads


Eric Amundson

August 20, 2015 at 11:48 am

So I see the [ESPRESSO_EVENT_ATTENDEES] shortcode to list attendees. Along with this I need to show the answer from a custom question. Is there a way to do this?

Thanks,
AJ


Lorenzo Orlando Caum

  • Support Staff

August 20, 2015 at 12:54 pm

Hi AJ, that parameter (answers to custom questions) is not currently available as an option for the [ESPRESSO_EVENT_ATTENDEES] shortcode.


Lorenzo


Eric Amundson

August 21, 2015 at 10:25 am

Hey Lorenzo,

Thanks for getting back to me on this. So I’ve been digging in the code trying to figure out how to get to the data and not having a lot of luck. I can probably build some queries to pull it from the DB faster than I can figure out how to use the existing objects… If anyone there has the time to take a quick look and help point me in the right direction I’d be happy to try and build it and create a pull request once I have it working.

Thanks,
AJ


Josh

  • Support Staff

August 24, 2015 at 5:24 pm

Hi AJ,

So you likely already know the question ID (QST_ID) for the row you want to query from _esp_answer table to get the answer value (ANS_value). Is that about right?

I can see where you’d run into issues when using the shortcode because the [ESPRESSO_EVENT_ATTENDEES] shortcode is pulling data from the Contact/Attendee instead of the actual registration. Mostly because a contact/Attendee can have multiple registrations, so even if you get all the related registrations for that contact and loop through them, how do you know which registration ID is the right one?

With the above in mind, I guess I’d advise to not use the ESPRESSO_EVENT_ATTENDEES shortcode and instead do a query on the registrations for that event or ticket, then you’ll have the correct registration ID every time. Along with that, once you have the registration object, you can use the answer_value_to_question() method from the EE_Registration class.


Josh

  • Support Staff

January 21, 2016 at 10:01 am

Update: There is now a quick start guide that shows how you can add answers to custom question fields to the attendee list in our documentation.

Viewing 4 reply threads

The support post ‘List attendees with aneser to custom questions’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso