Difference between [_THISROW].[_THIS] and [_THIS] in Form View

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.

11 Likes

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?

3 Likes

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])).

2 Likes

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

5 Likes

Thank you @dbaum for pointing out this case :blush: :+1:

1 Like

@jyothis_m

Good catch! and thanks for sharing.

Did you test this with New Desktop UX ? The same behaivior, did you observer with new desktop UX?

@takuya_miyai

@Arthur_Rallu

1 Like

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

Screen Recording

@jyothis_m

Thanks mate. This is useful.

@Arthur_Rallu

@Adam-google

Gentleman, this is better to look into… in preparation for new desktop UX release.

@takuya_miyai

1 Like

@jyothis_m

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???

2 Likes

Thank you @jyothis_m for the GIF. Now I got it :grinning_face:
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

Show More

Reset_Thisrow.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]&ā€)",
ā€œā€
)

5 Likes

I do the screen recording using ZD Soft Screen Recorder and then convert it to GIF online using EZGIF

2 Likes

I use Screen To Gif.

1 Like

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.

ezgif-4-444eb6f99c.gif

P.S.
I want more explanation in help page about [_THISROW]…