How to get context row value

Hello everyone

Is there any way to get row value in url

I want to use this value to update another table

Thank you!

Screen Shot 2022-07-13 at 12.13.06 PM.png

Solved Solved
1 28 769
1 ACCEPTED SOLUTION

You are very wrong, but you can't expect help without you giving vital info about your app.

I think your problem is quite simple, but without a proper explanation we can't do much.

Your OP was anything but complex, it was vague, telling us to get a value from the URL, which is not possible. Eventhough you are seeing a detail view for table 1, you want to run an action on table 2, because what you see at the bottom is an embeded inline view of table 2

View solution in original post

28 REPLIES 28

Aurelien
Google Developer Expert
Google Developer Expert
[_THISROW]

Screen Shot 2022-07-13 at 2.31.59 PM.png

Hello Aurelien,

 

Thank you for your response

Actually, I have 2 tables in same view, the action is belonged to below table, but I want to get KEY value of above table

Waiting for your solution

 

I got it 🙂

In your screenshot, you have the detail view of one table, and the related ref rows from another table.

The [_THISROW] expression will give you the current key-column of the record you are seeing on the Detail view.

Please note:

[_THISROW] is equivalent to [_THISROW].[yourKeyColumn]

You may want to explicit what you intend to do with it ? It may be more useful.

Screen Shot 2022-07-13 at 2.31.59 PM.png

 

Basically, I have details view of table 1 (red rectangle) and related rows from table 2 (green rectangle)

When I click 1 button check on table 2, I want to get KEY value from table 1 to paste that value to another table (check-button is 'Data: add a new row to another table using values from this row' fyi)

 

If in your table 2, you have a column named [table1] that is a Ref column that refers to Table 1, then your expression will be:

[table1]

 

I know your idea, but it's quite tricky that two tables have many-many relationship

Table 1 contains many sessions of a class, table 2 contains list of student in that class

So if I follow your instruction, result will be a list instead of single value

Aurelien
Google Developer Expert
Google Developer Expert

I don't get what you expect then.

I think I answered the question: "When I click 1 button check on table 2, I want to get KEY value from table 1 to paste that value to another table (check-button is 'Data: add a new row to another table using values from this row' fyi)"

Now, if your goal is different, why do'nt you say it at first ?

Make some tries, and tell us what you get. I won't keep answering to this thread while you don't try anything.

Don't get me wrong

As i said, if I follow your instruction (put table name on expression), result be will list of KEY on table1 instead of single value (refer screenshot for details), I just wanna get KEY of the row/screen I'm current be on

That's why I ask how to get row of current url

[table1]

Screen Shot 2022-07-13 at 4.24.34 PM.png

Can you share:

- screenshots of your table1, table2,  (from the app editor: Data>Columns)

- screenshot of your data action configuration

 

 

 

Screen Shot 2022-07-13 at 4.40.26 PM.png

Here's simulation of two table, table1 is linked to table2 by class_code which is not key column of neither two tables

Screenshot I shared above is view every time I click to view details of table1's row 

Let's say if I click to view session 1 on table 1, I only want to get KEY of that row (E599787D)

The issue you're running into is brought on by the fact that you're using many-to-many references in AppSheet.

  • You CAN use many-to-many... just like you CAN use SELECT() to get your data

are-you-sure-v9t4wx

What you really need is a bridge table connecting the two together.  This adds a layer of complexity to your system, but in the long run you actually open yourself to easier functionalities down the road.

If you created a bridge table, where the records connect the session-tp-the-student - then under the session, you'll have a NATIVE list of student bridge records (from which you can then create a derivative list, using list dereferences, of all the students).

Basically: you're missing a layer in your database.

@Aurelien was spot on all the way; you're just missing this one vital connection to make things work easily.

bridge table already exists, but it doesn't help in this case
somehow there're several people encounter this issue as well but no way to tackle this issue at the moment
(https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Modifying-data-of-a-table-from-another-table/m-... - cessnfrrg's comment)

 

Aurelien
Google Developer Expert
Google Developer Expert

I give up, sorry. I will keep answering the same thing, I think I misunderstand something.

Maybe @SkrOYC@Suvrutt_Gurjar @MultiTech @TeeSee1 @Steve  (without any preference order) or anyone else will be happy to provide more help.

Thank you anw, this issue remained for quite long time, but still there's no solution

Did you manage with it?
Because I have the same problem
I have an attendance that I need to mark, and I want him to take the lesson number from the top table

I used a workaround to handle this issue temporarily

Only CONTEXT(“ROW”) feature could be a complete solution and I'm still waiting for it:

https://www.googlecloudcommunity.com/gc/Feature-Ideas/CONTEXT-ROW/idi-p/453636

Which means, if I have a table of classes and a table of students and another table of attendance, in the table of classes I see the students who are associated with the current class, I added an action that marks attendance and thus it copies the student's details to the table of attendance, but I would like to mark exactly which class he is in It was found that I could not do it except in a roundabout way and only on the date of the lesson

It seems like you have 4 tables.

Classes, sessions (which are children of classes), students in course (which are children of classes and students) and students.

You want to see all students for a certain class no matter if they attended that session you are looking at? Why? What's the purpose of your action? You have a 5th table to check if they attended that session and you want to add their attendance to that 5th table from your current view?

Btw, where is the many-to-many you talked about? I don't see it on your schema

PS: To prevent people from loosing their time, post as much detail as possible of your need and your actual schema. When I say your need I mean what you want to accomplish on real life, which info you want to get, no what you think you need to do inside AppSheet (like using X, Y or Z action or column). Your OP was quite vague and not related to your actual question

yes, my OP is quite complex and I don't have time to explain all of that to you

I used appsheet for my whole company's operation so it expanded to this level

back to my original question, I just want to get row value of the current screen (appsheet have context(), but it doen't have option to get the row), I think we could conclude that it's not feasible at the moment and wait for appsheet updating

 

You are very wrong, but you can't expect help without you giving vital info about your app.

I think your problem is quite simple, but without a proper explanation we can't do much.

Your OP was anything but complex, it was vague, telling us to get a value from the URL, which is not possible. Eventhough you are seeing a detail view for table 1, you want to run an action on table 2, because what you see at the bottom is an embeded inline view of table 2

well, if you still believe its feasible then show me how to do based on above example or your own example, up to you

My suggestion:

Create a new post explaining your actual need, screenshots from the AppSheet editor, as asked by @Aurelien, all of the tables involved, the action you created and what you expect from that action, and on plain english your real world need instead of your AppSheet need.
For example, we don't know yet if what you want is to log if a student attended a certain session or not.

Finally, open your mind to better solutions, we can't teach someone to breath if they want to do it underwater

Aurelien
Google Developer Expert
Google Developer Expert

@SkrOYC I don't think there is any need to answer further on this post. I really appreciate your help on this case though 😄

@khiemtg just in case that can help you, here are some basics about how to post on the community:

Guide on How To Create a Community Post - Google Cloud Community

I truly hope you will eventually find the answer to your question.

ok thanks all of you anw, hope for a better appsheet

I really want to help you solve your problem, because I feel it's quite simple, but you have to explain us what you need a little bit better.

You are keeping vital info to yourself believing that it's enough for us to help when it's not.
Any development, including AppSheet development, is based on team work. I learned that I can't go that far if I try to solve problems alone.

It feels like you are afraid of us stealing your app idea or something

Appreciate your time!

I used appsheet for quite long time and researched a lot about this topic but there's no solution yet

I will explain to you more clearly when I have time

Best!

Just to throw out some extra information, to maybe point you in the right direction to a solution:

Have you heard of chaining the references?

Basically, as long as two records are connected in some way, through various other tables and reference connections, you can get data from one to the other. Depending on how your system is configured, determines the specifics for how you go about it; but as long as your tables are connected, you can get any piece of data from anywhere in the chain.

Perhaps this might help you get information from table A, through your bridge table, to table B.

[Table A Ref].[Bridge].[Table B]

__________________

 

Steve
Platinum 4
Platinum 4

What a mess.

Top Labels in this Space