[_THISROW-1] Explanation

I'm going through some courses at AppSheetTraining.com and in the current lesson, they use [_THISROW-1] in a document template. They explain that the minus one takes the expression back to the previous context, in this case, the Employee table.

I feel like something is not quite clicking for me to fully understand [_THISROW-1], and was hoping someone could perhaps this use case in a different way. My assumption is that in the previous <<Start>> statement, the context was the Employee table, but at the same time, the first use of [_THISROW-1] is before the initial <<Start>> statement terminates, it's inside a TemplateIf statement. 

[_THISROW-1] is used again in another <<Start>> statement, but given the above paragraph, i have confused myself as to why and when one would use [_THISROW-1], and what exactly it's doing


UCzOVF7

0 7 1,596
7 REPLIES 7

Steve
Platinum 4
Platinum 4

The documentation on this is pretty good, IMHO.  If you check that out, they explain how the -n syst...

On my last live stream, I actually started demoing how to build a nested start template like that - but faced technical difficulties towards the end that prevented me from finishing.  Despite the fact that I wasn't able to finish, there's some good tidbits of helpful info in there nonetheless.

One of the tidbits is an explanation of the difference between [_Thisrow-1] and [_ThisRow]

 

I also found out that [_THISROW-1] doesn't work with nested <<START...>>> in the same table in Google Doc template


@sak wrote:

in the same table in Google Doc template


Really?

I can see how this might get confused, as we are expecting:

  1. Root table
  2. 2nd table
  3. 3rd table

And if you had

  1. Root table
  2. 2nd table
  3. 2nd table

It might get confused... but I would think it wouldn't matter... that it would be driven by the -N and the fact that we're inside X layer already.

Can you describe your scenario where this didn't work?

sak_1-1696521928694.png

Hi,

Sorry for the late reply. Based on this example table. If I use [_THISROW-1] in Query 3, it will refer to the Query 1, not Query 2.

thank you both, @Steve and @MultiTech !

I tried searching for [_THISROW-1] but may have mistyped or something, who knows. At any rate, i am glad to have some stuff to read and watch to help solidify this concept.

Seems like it can get to be a bit difficult to keep up with where you are when working with templates.

Wouldn't it be something if the expression assistant and/or AppSheet Toolbox extension could talk to a Google sheet or doc and help with crafting those things?

Wishful thinking.


@mykrobinson wrote:

Wouldn't it be something if the expression assistant and/or AppSheet Toolbox extension could talk to a Google sheet or doc and help with crafting those things?

Wishful thinking.


1 year later, totally possible! ๐Ÿค–๐Ÿง ๐Ÿ’ช

I've been working on an Ai assistant project centered around my AppSheet build methodologies (code name Appster) when I have a spare moment, and while it doesn't have the ability to read from your document... you can just as easily copy your template formula into the formula space I've provided - and it'll help you find the solution.

  • Most times, provided clear instructions on what you want from it, it nails it within the first prompt or two.  If not, if you tell it what's wrong and what you want - it follows your lead and comes to the answer you want generally within 3 or 4 back and forths.
  • www.MultiTechVisions.com/appster

Fun how things evolve over time. (^_^)

Top Labels in this Space