List of events a user is registered for

Brenden Kehren asked on March 11, 2017 16:05

What's the best way to get a list of events a logged in user is registered for? Currently using event booking system as products in v9.

Correct Answer

Brenden Kehren answered on March 13, 2017 15:16

In v10 the order ID is no longer with the event attendee so you're correct but I'm working in v9. My first thought was to use the email, although no all that robust if you ask me so I was looking for some other magic way but unfortunately email must be the way.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Trevor Fayas answered on March 13, 2017 13:53 (last edited on March 13, 2017 13:54)

just a normal repeater with the where condition that does a lookup (select events where event id in (select event id from register events where user id = current user))

Or a Repeater with custom query. Write a query that you can pass the where condition of the user id (via macro) and then transform. I don't have the table structure in front of me but the event registrations will probably have their own table.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 13, 2017 14:54

I figured that Trevor, unfortunately, there is no linking ID that I'm aware of with a user and an event attendee.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on March 13, 2017 14:57

Sorry, was on mobile so didn't see it was you Brenden! Otherwise would have assumed not that simple. Let me see if i can figure it out...

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on March 13, 2017 15:03 (last edited on March 13, 2017 15:05)

There's no UserID on the Events_Attendee table, but out of curiosity why not just look up on the email address?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 13, 2017 15:06

Right Trevor but the only link for a current user is the order id in the event attendee table. What I'm looking for is the best way to find out what events a user is registered for. But it looks like I have to go through all of a users orders to get that information which is not really ideal or fast for that matter.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on March 13, 2017 15:12 (last edited on December 10, 2019 02:30)

Odd i'm not seeing an OrderID, is that in another table?

SELECT TOP 1000 [AttendeeID]
      ,[AttendeeEmail]
      ,[AttendeeFirstName]
      ,[AttendeeLastName]
      ,[AttendeePhone]
      ,[AttendeeEventNodeID]
      ,[AttendeeGUID]
      ,[AttendeeLastModified]
  FROM [Events_Attendee]

I would just do for there WHERE:

"NodeID in (Select AttendeeEventNodeID from Events_Attendee where AttendeeEmail = '{% MembershipContext.AuthenticatedUser.Email |(identity)GlobalAdministrator%}')

Wouldn't that work?

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on March 13, 2017 15:20

Must have been a later hotfix of V9 that it was added in, i have a test base Kentico 9 and it doesn't have an OrderID (Must have been added to allow you to do paid registrations)

Yeah it's a lot of pain to go through all the ecommerce tables... I guess the only other solution for future events would be to extend the events table and track somewhere the attendee ID and the user ID, but that's a bit overkill.

0 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on March 14, 2017 06:46

Hi all,
I have some solutions for you:
1) OrderID field has never existed in attendee table as out-of-the-box functionality, but there is a package Events as products (github page) for Kentico 8, which adds OrderID column to attendee table. You can apply the same code to Kentico 9 or 10.
2) Create a custom table for relations between attendees and orders
3) Save attendee id in OrderCustomData field of COM_Order table

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 14, 2017 13:43

Yes, I failed to preface this post with that Anton, I am using some of those features from the Events as products article, which is where the order ID info came from. Again, still not ideal to get a simple list of events a particular person is attending.

0 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on March 14, 2017 17:27

Any solution will be not ideal, because it's not out of the box and you need to do some things around Kentico:) And I think the solutions will be better than searching events by attendee email, because in case if a user wants to register for event with another email, it won't work. But it depends on what criterias your project has.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.