Table relations

Hi everyone,

why can’t I relate these tables?
I would like to obtain the ID of the user who commented

Thank you

Relations work by matching two values.
You are trying to match the RowID value in the Comments table with the RowID value in the Users table. This will never work, because all RowIDs are unique.

What you need to do is add a column to your Comments table to store a UserID, then when a Row is added to that table write the Users RowID into that column. Then you can use that column to create a relation to your Users table.

Now the problem is how to copy it :smile: , I could copy the iduser into the comments table, when a user registers, correct?
Do you have any suggestions how to do this?

I thank

No, you do it when a row is added to the Comments table.
How does that happen - do you use a form?

maybe I understood and it seems to work, see photo.

How is that action triggered?
Is it an onSubmit action with a Form?
If yes, don’t do that - it’s not 100% reliable.
Instead, pass the UserID as a User Profile Value with your Form.

1 Like

is activated via comments

Okay, I suggest you review the documentation for the Comments component.
If you configure it as per the guide, you will get what you want.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.