Make the fields only editable through the action"

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.

4 Likes

In Editable? I put FALSE.
image

2 Likes

That will prevent Action from editing the field. Action will be runnable, but it end up with error, saying “Field can not be edited”.

2 Likes

Ahhhh, I have to avoid it then. :man_facepalming:

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.

8 Likes

Hi @Heru @Steve

Thank you for your advice. I created create new app from scratch and tested “false” method, and actually it worked.
Thank you again.

4 Likes

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…

1 Like

I just add this code in conditions of edit if:
USEREMAIL()=noemail@gmail.com

1 Like