Does anyone know how to ensure that the CSV import adheres to column behavior?
My CSV Import button is ignoring the formulas in valid_ifs, because Google Support says it should be enforced. So one column shouldn’t be updatable, like how the app works, right?
I suspect on a CSV import that the [_THISROW_BEFORE] qualifier is not valid and therefore possibly the expression is ignored. But I don’t know for sure.
I think so… but if that’s the case, import is not enforcing Valid_If.
I raised this concern with chat support, but they had no answer and escalated it to an AppSheet specialist.
Just looking for other members here to see if they have the same issue.
It is all dependent on whether the import function tracks a “before” state of the row versus an “after” state. Typically for imports, the rows are just dumped into the system they are being imported into. Even in the case of an update, the system may just overwrite the columns if validation passes.
You can probably test this. Import a couple of test rows and change the Valid_IF to something simple like… [Category Name] = “Test Value”. Have one row with “Test Value” and the other with something else. Confirm the first is loaded and the second doesn’t and verify there is an Audit Log entry for the failed row.
Now change the expression to include [_THISROW_BEFORE] qualifier. Something like:
I’ve never used CVS import, but I would expect the CVS values to be the _THISROW_BEFORE values, and that the existence of a value in a CVS column would obviate Initial value for that column of the row.
We understand you’re experiencing an issue where the CSV Import button is ignoring formulas in valid_ifs.
The link you provided indicates that [_thisrow_before] and [_thisrow_after] are being used in the valid if section of the column.
It’s important to note that [_THISROW_BEFORE] is a context-dependent reference in AppSheet. It retrieves the value of a column before a data change is processed by the system.This expression works reliably in the background during Automation but does not work reliably in client-side contexts (within the app interface). Constraints such as Show If, Editable If, and Valid If are continuously evaluated as you have interacted with the form. These contexts do not reliably maintain the record’s “before” state after the initial load. Consequently, the valid if condition did not function as expected, and data was uploaded to the table via the “import a CSV action.”
We hope this information is helpful.
Please feel free to contact us for any further query.
I think it makes sense, since the formula works with the form view.
I’ll just apply @Steve logic as current behavior, to make my life easier
In my experience, _THISROW_BEFORE works predictably and “reliably” in (at least most) “client-side contexts (within the app interfaces)”, you just have to understand how it works. Knowing how AppSheet works is not Support’s strong suit.