Make input as referenced ID

Hello, I have 2 tables. I want to allow users to make comments, and comments will be stored in a table. It is easy to force user's email appear next to comment in the table (hidden input = USEREMAIL() )

But is it possible to add user's email ID instead of email? Somehow taken from another table (users) with ref?



Users

IDUserEmail
1email1
2email2
3email3

Comments (inputed by user) PREFFERED VERSION

IDUserIDComment
autogenerated2some text
autogenerated2some text
autogenerated3some text

Comments (easy version)

IDUserEmailComment
autogeneratedemail1some text
autogeneratedemail2some text
autogeneratedemail3some text

 

Solved Solved
0 1 41
1 ACCEPTED SOLUTION

If understanding of your requirement is correct, please make the [UserID] column in the "Comments" table as reference column to the Users table.

In the initial value setting of the [UserID] column in the "Comments" table, please add an expression something like ANY(SELECT(Users{ID], [UserEmail]=USEREMAIL()))

Please make the ediatable_If setting of [UserID] column in the "Comments" table as FALSE  or deselect Show_if setting of this column.

To improve the use of User based values in an app, please take a look at the following epic tip

Current User (Slice) | How to conform your app a... - Google Cloud Community

The use of tip will help  you get rid of longer expressions like ANY(SELECT(Users{ID], [UserEmail]=USEREMAIL()))  while accessing a current user based values.

View solution in original post

1 REPLY 1

If understanding of your requirement is correct, please make the [UserID] column in the "Comments" table as reference column to the Users table.

In the initial value setting of the [UserID] column in the "Comments" table, please add an expression something like ANY(SELECT(Users{ID], [UserEmail]=USEREMAIL()))

Please make the ediatable_If setting of [UserID] column in the "Comments" table as FALSE  or deselect Show_if setting of this column.

To improve the use of User based values in an app, please take a look at the following epic tip

Current User (Slice) | How to conform your app a... - Google Cloud Community

The use of tip will help  you get rid of longer expressions like ANY(SELECT(Users{ID], [UserEmail]=USEREMAIL()))  while accessing a current user based values.

Top Labels in this Space