Relational Data Search issues for social app with invites

My app allows people to create events and invite other users (via email). My data model is as follows

User (built in data type)

  • EmailAddress

Attendee

  • EmailAddress
  • InviteStatus

Event

  • CreatedByUser
  • Date
  • Attendees (list of type Atendee)

When a user creates an Event (and Attendees), I add a record for each attendee with an InviteStatus of pending. The Attendees each get an email with a link to the app.

When an Attendee clicks on the link to sign up to the app I want to display a list of events they have been invited to as soon as they have registered. In order to do this I need to search Events that have attendees matching the email address of the user who signed up.

Here’s what I’m doing with the repeating group to show the Events:

  • Type of content: Event
  • Data source:
    Search for Events
    -> Type: Event
    Constraint: Attendees contains: Search for Attendees
    -> Type: Attendee
    Constraint: Email = Current User’s Email

The issue checker is suggesting there’s an issue with the type. It says: "Search for Events. Value should be an Attendee but right now it’s a list of Attendees.

Is there a limitation that prevents me from doing the query I want to do?

Thanks

how are you adding two types? shouldn’t it be do a search for Events, type:Event, constraint: Attendee = Current users email?

Yes, it is a little quirk of Bubble I think.

The search always returns a list. Even though YOU know you should be getting a single row back.

The way round this is to use the :first row.

An alternative would be to accept a parameter into the page, and for that to be the id, although it is a while since I did this (and this was before page parameters) and I remember having issues and having to do a :first anyway.

Specifying :first item solved the problem.

Thanks

1 Like