What is [_this]?

HCF
New Member

What does [_This] refer to?

Solved Solved
1 3 3,420
1 ACCEPTED SOLUTION

The majority of the times I use [_this] is inside a Show If/Required if/etc. when I need to use the value that has been entered or selected by the user.

For instance:
If I have a reference field in a form, thatโ€™s always preset by an action, I can usually hide that inside the form.

  • Thereโ€™s nothing for the user to do (itโ€™s already set by the system (and in fact any interference would cause the appropriate links to be switched)), so hiding it when the user is submitting data can be helpful (to reduce clutter in the form).
    • Show If = CONTEXT("ViewType") <> "Form"

But if I allow some other ways of creating the record, that essential reference link might be left blank - at which point I need to show that field to the users so they can fill it.

  • Show If:
If(Context("ViewType") = "Form", 
  IsBlank([_THIS]), 
true)

This hides the field inside the form if the field itself has a value, if its left blank then it will be shown - but as soon as the user makes a change it will immediately disappear.


Another common use will be to check if the value entered into a field is already inside the table:

Not(In([_THIS], Select(Table[Same_Column_As_THIS], [RowID] <> [_thisrow].[RowID])))

View solution in original post

3 REPLIES 3



It is actually a syntactic shorthand referring to โ€˜that columnโ€™ explicitly.

Just to add to @LeventK โ€˜thisโ€™ in general in a lot of programming languages is actually a self reference, literally meaning to reference โ€˜itselfโ€™. So when used in Appsheet within an expression for a column [_THIS] literally points to the column itself.

The majority of the times I use [_this] is inside a Show If/Required if/etc. when I need to use the value that has been entered or selected by the user.

For instance:
If I have a reference field in a form, thatโ€™s always preset by an action, I can usually hide that inside the form.

  • Thereโ€™s nothing for the user to do (itโ€™s already set by the system (and in fact any interference would cause the appropriate links to be switched)), so hiding it when the user is submitting data can be helpful (to reduce clutter in the form).
    • Show If = CONTEXT("ViewType") <> "Form"

But if I allow some other ways of creating the record, that essential reference link might be left blank - at which point I need to show that field to the users so they can fill it.

  • Show If:
If(Context("ViewType") = "Form", 
  IsBlank([_THIS]), 
true)

This hides the field inside the form if the field itself has a value, if its left blank then it will be shown - but as soon as the user makes a change it will immediately disappear.


Another common use will be to check if the value entered into a field is already inside the table:

Not(In([_THIS], Select(Table[Same_Column_As_THIS], [RowID] <> [_thisrow].[RowID])))

Top Labels in this Space