How to make a table/column to be writable only through API?

rhen
New Member

I have created an app that represents data from an internal system
I updated data in the app using AppSheet API and I donโ€™t want users to able to edit/add/delete data.

My issue is that if I remove the edit access from a table/column, I canโ€™t update the data from API calls neither.

Is there a way to allow write access through API calls, but prevent modifications from the AppSheet interface?

Thank you,
Tamas

Solved Solved
0 4 275
1 ACCEPTED SOLUTION

Sure thing. You can attempt to use the CONTEXT(Host)=โ€œServerโ€ expression in the TABLE โ€œAre updates allowed?โ€ dynamic expression areaโ€ฆ Maybe something like thisโ€ฆ

SWITCH(CONTEXT(Host),
โ€œServerโ€, โ€œALL_CHANGESโ€,
โ€œREAD_ONLYโ€)

I say attempt because Iโ€™ve never actually done this.

View solution in original post

4 REPLIES 4

Sure thing. You can attempt to use the CONTEXT(Host)=โ€œServerโ€ expression in the TABLE โ€œAre updates allowed?โ€ dynamic expression areaโ€ฆ Maybe something like thisโ€ฆ

SWITCH(CONTEXT(Host),
โ€œServerโ€, โ€œALL_CHANGESโ€,
โ€œREAD_ONLYโ€)

I say attempt because Iโ€™ve never actually done this.

Iโ€™ve just done this and can say that this is working

Thanks @Grant_Stead, it works fine.

Do you know maybe how can I combine this with useremail()?
So some users able to edit.

You should be able to layer in some OR() / AND() expressions as needed.

Do you leverage a user table for permissions, or are there just a few exceptions that you want to hardcode?

Top Labels in this Space