I found this recently while filling a form in Appsheet. Thought of sharing it with the community.
[_THISROW].[_THIS] value of the current column current row (from table i.e. ghseet in my case)
[_THIS] value of the current column in the form-view
I shall describe the usage of both with a sample scenerio
Consider a table with 2 columns [Date] , [Shift]
Lets say we want to set the initial value of column [Shift] based on the value of column [Date]
For this I can use either of the two expressions given below
IF([_Thisrow].[Date]=TODAY(),"A","B")
IF([Date]=TODAY(),"A","B")
The first expression will consider the value of Date from Gsheet i.e. the saved data from Table
The second expression will consider the value of Date from the Form-View i.e. if i change the Date in the Form-View, the Shift updates instantly in the Form-View which does not happen in the case of first expression.
Hope this is useful.
That's cool thank you @jyothis_m. I'm think many of us thought that [Column] and [_THISROW].[Column] would be exactly the same.
If I understand right, you are not talking about Add a new row, but about Edit an existing row, right? If so I think you have enabled "Reset on Edit" to force the initial value to recalculate, right?
Is [_THISROW].[Date] acting the same as [_THISROW_BEFORE].[Date]?
May you also share a usecase for that? I think that the initial value of column [Shift] will behalf different in Add and in Edit. How do you communicate this to the users so that they don't get confused?
Re use case: Various community posts reference leveraging this distinction in Valid if expressions to prevent duplicate values across a column's rows--e.g., NOT(IN([_THIS], Table[Column] - [_THISROW].[Column]))
.
Thank you @dbaum for pointing out this case 😊👍
Thank you @Fabian_Weller
I have checked both the cases i.e. ADD and EDIT please see the GIF below.
ADD and EDIT ROW
[DATE] always updates and takes the live value from Form-View for both ADD and EDIT
[_THISROW].[DATE] as well as [_THISROW_BEFORE].[DATE] is behaving the same way and does not update unless the Form is saved for both ADD and EDIT
Hope this is what you were referring to
Thank you @jyothis_m for the GIF. Now I got it 😀
So [_THISROW].[Column] or [_THISROW_BEFORE].[Column] memorizes the Initial value in an add. Or the value in the sheet in an edit. That's quite interesting. I didn't expect that [_THISROW_BEFORE].[Column] would work in an add.
One usecase that comes to my mind: You can show the "before value" in the column description., or in a VC. You can show the before value only if the value has changed.
But in my testings this is working only with
[_THISROW_BEFORE].[Column]
Not with
[_THISROW].[Column]
Nor with
[_THISROW].[_THIS] (gives the error "Unable to find column '_THIS'")
Here is the GIF
This is the expression I use in Column Description of column [Enum]:
"Enum"&
IF(
[_THISROW_BEFORE].[Enum]<>[Enum],
" (the before value was: "&[_THISROW_BEFORE].[Enum]&")",
""
)
Good catch! and thanks for sharing.
Did you test this with New Desktop UX ? The same behaivior, did you observer with new desktop UX?
Hi @Koichi_Tsuji I have tested it now in the New Desktop UX. There is some change seen here. Posting the screen recording of the same below
Thanks mate. This is useful.
Gentleman, this is better to look into.... in preparation for new desktop UX release.
Sorry for this question which is nothing to do with your topic.
Which and what GIF service are you using to capture the GIF you are shering here???
I do the screen recording using ZD Soft Screen Recorder and then convert it to GIF online using EZGIF
I use Screen To Gif.
Great Tip! Thank you very much!
I find that if [_THISROW] is used in SHOW? expression it's calcurated not only when saved but also the other page is selected. So [_THISROW] probaly don't consider value from G sheet in SHOW? expression.
P.S.
I want more explanation in help page about [_THISROW]...