Have testing with try and error to find out a way to get the required functionality to โmake the fields only editable through the actionโ.
I believe there should be far better way, very courious how app creators are manageing. Welcome to hear your tricks.
What I wanted to control the fileds setting is to let a filed to be โeditableโ by action only. When the app user open up form view, then they are not able to edit, but the field value is viewable only. But through appsheet action, the field are editable.
I simply add
context(โViewTypeโ)<>โFormโ
to EDITIF constrain and eventually I got the required result.
In Editable? I put FALSE.
That will prevent Action from editing the field. Action will be runnable, but it end up with error, saying โField can not be editedโ.
Ahhhh, I have to avoid it then.
I am just using it for a simple app, and action is working, including changing the field in the source.
I read it somewhere about this FALSE, thatโs why I implement it.
Yes, putting FALSE is to prevent the field from being updated by user from the form, but it also prevent apphsheet action to update as well.
Thats why I have been thinking of workaround and come up with this tricks, but probably there will be another way to do the same job.
I set Editable? to the expression, FALSE
, as @Heru suggested. It prevents all user edits but allows app edits, such as by actions. Note that this is different from setting Editable? to OFF, which prevents all modifications.
That is a helpful tip. But doesnโt it make sense to have the editable setting ONLY apply to the user editing it and not actions or app formulas?
In earlier versions of the app editor, the setting was Read-only rather than Editable?. Itโs intent was to make the column entirely unmodifiable, even by the app. As a developer, I see a value in being able to prevent all modifications, including accidental ones. Itโs also has good security potential. I myself am happy with the current approach, but wish there was a better way to communicate how it worksโฆ
Actually, it is helpful. Thatโs exactly what I was looking for.
I donโt want the user to edit the field. But I need my actions to run and edit the fields as programmed.
In my case is useful.
I really needed this, thank you!
Although I think it's not very intuitive, almost impossible to guess without forums.
I just add this code in conditions of edit if:
USEREMAIL()=noemail@gmail.com
This is precisely what I was struggling with!
Thank you @Koichi_Tsuji what a clever way to resolve this issue. I was on the right path trying different expressions using the CONTEXT() function but I couldn't really get there.