I need to create an event application where each event has a button that allows users to confirm their attendance. When a user confirms, a new row is added to the Registro table, storing both the event details and the user’s information.
However, I also want to allow users to cancel their attendance through another button.
I created a Relation column in both the User and Event tables to link the attendance row in the Registro table to both the user and the event, so I can display them correctly. However, when I delete the Relation column, it removes all events associated with that user instead of only the specific event I want to cancel.
The challenge is how to select a specific row to delete, particularly the row that corresponds to the currently open event and the user who is canceling. How can I achieve this?
Sounds like your relation to the registration rows may need some tweaking. If it’s deleting multiple rows, then you’ve checked the “match multiple” box on the relation column. In this case, you’d want to uncheck that box to make it a single relation. Sounds like it’s also not pulling in the desired results. If it’s pulling in matches for other events besides the one the user is currently viewing, then you need to create a stronger “key” to find the exact match for the user’s registration record. You can achieve this by using template columns to create the relation on. Here’s the docs on all that!
The action I was thinking of was the delete row. But I delete the relation row, I will delete all the event or person related. I only want to delete the subscription of the logged person who press the button for that specific event.
Maybe in the Events tab (or table, as it’s actually called ) add a Query column, set the source to that relation, and add a filter where the column of the ID of the user who registered in the Register table is equal to the User Profile > Row ID? And set your Delete row action to that new Query column?
As far as stronger key, you can do exactly what comment above says! For good measure, you may want to uncheck that “match multiple” on the Query itself to avoid deleting multiple registrations. Also, might want to relabel those ID columns ( User ID / Event ID) in Registro table so when you build the query on your Events table you don’t mix them up!