Match the current value of a column of the records in another table

When I click on a name (field called NAME) in a table called CLIENTS, I’d like to have the exercises (field called EXERCISE_NAME, table called EXERCISES) performed by a client (field called NAME, table called EXERCISE) listed under the client’s name. ANY(SELECT(EXERCISES[EXERCISE_NAME], [NAME] = . Here is where I get stuck. I want NAME in the table EXERCISES to match the value of the NAME in the current record in the table CLIENTS. What is the syntax for that?

Hi @EDLMaine,
Welcome to AppSheet community.

You have mentioned list of exercises, in that case, in general the expression syntax will be
SELECT(EXERCISES[EXERCISE_NAME], [NAMEe] =[_THISROW].[NAMEc])

Here [NAMEe] is the name field in the EXERCISES table and [NAMEc]is the name field in the client table. Wrapping SELECT with ANY such as ANY(SELECT(… will return only one arbitrary value of the [EXERCISE_NAME]

In this expressions context as your requirement is related to one ( CLIENTS) record to many( EXERCISES) records, you may wish to take a look at references between table article just in case you have not.

2 Likes

2X_e_ea7df583983133b62712b5e73bffbcd45cc53736.gif
Perfect. Thank you. Is there a way to format the list? For example, one exercise per line.

Hi @EDLMaine,

Yes , you can have related records or child records displayed one per line.

As I mentioned, please take a look at the article on referencing between tables. Please also take a look at the following sample appmentioned below where it shows related records. Please note the image below, the order details are line items related to each order , listed one per line.

Hope this helps.

https://www.appsheet.com/samples/An-app-for-managing-customers-products-and-orders?appGuidString=245700e5-9061-4045-843f-7850b5eb439a

3 Likes

2X_e_ea7df583983133b62712b5e73bffbcd45cc53736.gif
Thank you. This is extremely helpful.

2 Likes