Grab values from one table to another

Hello, I was trying to use an expression like the following:

ANY(SELECT(commentsSection[Comment Response],AND("Jhonny Tbone"=[Assigned Employee],[Assigned Employee]=[Comment Corner ID]))) experimenting with pulling it for Jhonny Tbone for this example

However this doesn't work and figuring out this expression has been very difficult in AppSheet to figure because of their weird syntax and makes no sense to me. I have 2 tables Comment Corner and commentsSection. commentsSection stores the values of all my comments and table Comment Corner stores the values of of my discussion posts. I linked the 2 tables together by using an ID in commentsSection to link to Comment Corner so that the comments would be placed under the correct discussion heading. I'm trying to figure out how to pull all the comments of a discussion topic per user and it's been challenging to say the least. The expression: SELECT(commentsSection[Comment Response],[_THISROW]=[Comment Corner ID],FALSE) pulls all of my comments per discussion topic, but not per user like I wanted. I tried the one from above, but it goes horrifically and doesn't work at all for whatever reason. Hope this makes sense 

commentsSection has Employee, Comment Response, and Comment Corner ID

Comment Corner has ID and Assigned Employee

0 5 138
5 REPLIES 5

Hi @bman22 
Do you have table with all users in your app? If so you could ref this table with every content user creates. Probably when user creates topic or adds new comment there is a column where you store UserLog. You could reference that to USERS table I guess. It would automatically create List_of_Ref in this table. If you wanna do it another way show us please your tables structure straight from the app editor it will be much easier to understand ๐Ÿ˜Š
Cheers

What about the expression: the column Comments and Questions from the Comment Corner table equals the Comment Corner ID from the commentsSection table. That way I can map the 2 together, I should be able to use a simple expression for this, but when I try: SELECT(Comment Corner[Comments and Questions Combined],[_THISROW].[Comment Corner ID]=[Comment Corner ID],FALSE) it fails and I don't understand why. 

Can you show us the app editor view where you are trying to use this formula? When you use select() result is list of values. Maybe the column where you are trying to use it is another type?

I was trying not to show pictures if I didn't need to, but I might need to. All this is is trying to use the SELECT function to grab values associated with a key from one table to another. So the commentsSection (table) has the Comment Corner ID (key), which is the same key value as the ID (key) of the Comment Corner (table) (that way the comments can be placed under the correct discussion). I then wanted the ability to grab Comment Response (value) and/or Discussion Response (value) based on whichever table I needed grab the data for a virtual column so that I could then place that data into a view. I hope this makes sense, I didn't know if I needed to use FILTER or if it was a combination between FILTER and SELECT functions. If it doesn't I can take screenshots, though when I try the expressions they show up as everything or nothing when I go to test them

Am I right that you need two conditions for SELECT()? If so try to use AND() inside of your SELECT() maybe.

"The expression: SELECT(commentsSection[Comment Response],[_THISROW]=[Comment Corner ID],FALSE) pulls all of my comments per discussion topic, but not per user like I wanted."


Reading just text and trying to imagine how you have designed your app is quite tough. Do not feel disappointed if anyone has some troubles understanding what you are trying to explain ๐Ÿ˜Š

Top Labels in this Space