Suppose I have a table,
TableA(Column1, Column2)
In the Column1โs โValid if - EXPRESSION ASSISTANTโ, the [_THIS] refer to the Column1โs value shown on TableAโs forms (Add or Edit). How can I refer/use the Column2โs form value in the Column1โs EXPRESSION ASSISTANT?
Regards,
Solved! Go to Solution.
Functions that do table lookups, like FILTER(), LOOKUP(), and SELECT(), actually reference the table, not the copy of the row in the editor. Try this to get the saved copy:
LOOKUP(
[_THISROW].[key-column],
"table-name",
"key-column",
"Void"
)
replacing table-name
with the name of the table and key-column
with the name of the tableโs key column. Note that [_THISROW].
is required in the above.
You can then wrap this LOOKUP() expression in ISNOTBLANK() in your Valid If expression.
See also:
Hi @Swoopy,
If I clearly understand your requirement, if you wish to use value from Column2 in the valid if of Column1 , please use an expression something like [Column2]= โGreatโ or [Column2]>10
In short mention column2 name and a value for that column that makes Column1 valid.
Please let us know if you are looking for something else.
Thank you. Iโm too newbie in this environment
Hi @Swoopy,
No problem. We are all beginners in the initial stages for any new thing. Please do ask your questions anytime. AppSheet community is a great community.
My table has a column Void containing texts (โNoโ and โVoidโ). I tested its value using ISNOTBLANK([_THISROW].[Void]) in Valid If of column Quantity. When open Edit form of this table, it shows โThis entry is invalidโ (which means itโs blank), why?
Remove [_THISROW].
from the expression.
My understanding of AppSheet environment is that the [Void] alone (without [_THISROW]) in Valid If refers to the value of Void field on the Edit form. I need to refer the Void value in the table I am about to edit its row.
Your understanding is incorrect.
I re-tested the [Void] alone without โ[_THISROW].โ
If the Edit form is just open, [Void] value is equal to the Void of that row saved in table.
If I change the Void field on Edit form, [Void] keeps the new value on-the-fly.
However, I have a situation that my condition requires to compare the old value of Void previously saved in table -with- the Void value selected by user on Edit form. But I donโt know how to refer to the tableโs void value if user changes the void field.
Regards,
If you need to be able to use the previous value entered by a user, youโll need some way to store that variable separately from the main data-entry field; this way you have two fields in which you can compare them against each other and do logic functions.
Youโll also need another field to be the โdisplayโ field - that watches the โchangeโ field and if itโs empty it copies the original value, if itโs changed it copies the new value. This gives you a single field in which to display to users. Unless you wish to show the original and the change, etcโฆ you can see thereโs a lot here.
Alternatively, if you just need to trigger a workflow if someone has changed a value from the original, thereโs a way to reference the previous value of a form in logic:
Functions that do table lookups, like FILTER(), LOOKUP(), and SELECT(), actually reference the table, not the copy of the row in the editor. Try this to get the saved copy:
LOOKUP(
[_THISROW].[key-column],
"table-name",
"key-column",
"Void"
)
replacing table-name
with the name of the table and key-column
with the name of the tableโs key column. Note that [_THISROW].
is required in the above.
You can then wrap this LOOKUP() expression in ISNOTBLANK() in your Valid If expression.
See also:
Thank you so much. Now Iโam able to carry on my learning project.
User | Count |
---|---|
41 | |
35 | |
27 | |
23 | |
16 |