Hi all, my question re AppSheet is, can each ...

(Will Badel) #1

Hi all, my question re AppSheet is, can each user I have in my DB only see information related to them and not the entire database?

(Will Badel) #2

@Aleksi_Alkio hi aleksi, sorry to bother again, im not following the security filters code, I have data from two different email users in the googlesheet. i would like only user wbadel79@gmail.com to see wbadel79@gmail.com rows of data. Can you assist with the correct code protocol please?

(Bellave Jayaram) #3

Yes

(Will Badel) #4

Thanks Bellave. Could you briefly explain how that works? Is it basically restricting access based in their email address?

(Will Badel) #5

Aleksi, i’ve also tried to make one user or email account the admin, hence they can see and do everything. When i log in with this account i can only see the the data for the corresponding admin email (per the security expression) How can i allow this person to see everything? The 1=1 expression sorry again doesnt make sense to me.

Currently i have this which fetches user data matching the login email which is great [Email]=USEREMAIL()

How would i allow one or two emails to access everything?

(Segolene Sansom) #6

if i may, i’ve done this in my tables - I create a user table which contains email, first & last name and company grade (Admin, Team Member, restricted)

I’ve then created a slice and a new UX view which filters for email=useremail() for any data I want people to only view their own data In the showif component of the views for the everything view i would put: in(“Admin”,Select(Users[Grade],[email]=Useremail()))

For the people who are restricted to only their entries - in the UX for that slice: in(“Restricted”,Select(Users[Grade],[email]=Useremail()))

PS: if you have related views, create new virtual columns in the main one and link it to the slice which will give you your related view tables with only their own data

(Aleksi Alkio) #7

Another approach… if you have only one admin user, you could write the formula like OR([Email]=USEREMAIL(),USEREMAIL()=“admin@email.com”)

(Will Badel) #8

Thanks everyone, I’m very new to all this, appreciate the feedback

(Bellave Jayaram) #9

Yes, you would have all data in each sheet filtered out based on the user’s email which they will need to use to authenticate. You, as the app creator get to maintain access to the app by adding the emails to the white list which is set in the Users tab of the App Editor.

(Will Badel) #10

Thanks Bellave, is there a video tutorial on this anywhere that you know of?

(Bellave Jayaram) #11

Try here - https://www.youtube.com/channel/UC7xYEO2O_VZWyvctU0LQp8g

(Aleksi Alkio) #12

These two articles may help you either…

https://help.appsheet.com/security/security-filters/security-filters-the-essentials

help.appsheet.com - Slice Row Filter Conditions Slice Row Filter Conditions help.appsheet.com

(Aleksi Alkio) #13

You probably have a column [Email] in your table. You can then add a formula like [Email]=USEREMAIL() and that will take care of it. It means… you only need to write a formula where the result is either TRUE or FALSE. In this case when the user wbadel79@gmail.com is using the app, in his/her row the answer is TRUE and he/she will see it. If the user is somebody else, the answer is FALSE and he/she won’t see it.

So… you can write what ever expression you want. The result just need to be TRUE or FALSE. If you type 1=1, everybody can see that record. If you type [Date]=TODAY(), all users will see the record only today if [Date] is today.

(Will Badel) #14

thank you aleksi, i believe that has worked for me. i really appreciate your assistance

(Aleksi Alkio) #15

You’re welcome