How do Insert childrow only if it’s not there yet?

Go to say, this is basic/easy to solved in RDBMS app. But, with glide I need to relearn this: the #glideway. I hope there is a way though :slight_smile:

So, I have User => Event => EventUser: trivial right?
In Event I have already have relation EventUser: to track users registered to an event.

In this screen (Event displaying inline of EventUser for registered user), the red button should only be visible if this User hasn’t yet registered to Event (an entry in EventUser). How do I do this?

In glide term, in this screen, I can only uses Relation from Event to User, right? But it didn’t allow me to check wether this user already there in child sheet: EventUser.

How do I solve this? Thanks!

  • Create a template column in your Events table that joins the EventID to the current User ID (User Profile → Row ID)
  • Create a similar template in your EventUsers table that joins the EventID and UserID columns
  • Create a relation between those two columns. From the Event table to the EventUsers table
  • Show the button when that relation is empty.
2 Likes

This looks promising! Will check and back to you soon! Thanks!

Another question: I sometimes can delete an entry of EventUser. But sometimes though, the Edit button disabled and I can’t edit it.

I check in the sheet, the data there. How does Glide hasn’t pick that yet?
But upon closing and reopening the app, it works.

I haven’t check this outside glide IDE… but will this occur though?

I don’t think I can explain that. Do you have row owners in the table this screen is attached to? Sometimes you can get odd behaviour in the builder when row owners are involved, especially if you are switching between viewing as different users. But I wouldn’t worry about it, unless you see the same behaviour in the published app.

1 Like

Got it. No row owner here.
Yes, will check later in the published app