Slices and users

I have a โ€œusersโ€ table where I insert email and the name of the professor. In the questionnaire table I ask the pupil to enter the name of their teacher. How can I make sure that the teachers, entering with their email, see only the students of their competence? I hope I explained myself well โ€ฆ I tried with the slices but I just canโ€™t understand how I can do it โ€ฆ please can you give me a hand?

0 13 113
13 REPLIES 13

Aurelien
Google Developer Expert
Google Developer Expert

Hi @AdministraCED_italy

Please find below my suggestion:

Assuming you have a table โ€œUsersโ€ with minimal columns:

  • [Users] ==> set as key-column, type Email
  • [Profile] ==> type Enum, values โ€œStudentโ€ or โ€œProfessorโ€

Assuming you have a table โ€œQuestionnaireLogโ€ with minimal columns:

  • [key] ==> set as key-column, type Text, initial value expression UNIQUEID()
  • [Student] ==>type Ref, source table name Users, initial value expression USEREMAIL()
  • [Teacher] ==> type Enum, base type Ref, source table name : Users, Valid_If expression: FILTER("Users", [Profile]="Professor")

So, the slice โ€œMyStudentsโ€ for your teachers will have a row filter condition:
USEREMAIL()=[Teacher]

Let us know if that works for you !

I have two different applications: one for compilation by students and one for visualization by professors. each professor accesses with their own email, inserted in a special table with the professorโ€™s name and email, while the students, when filling out the app, report only the professorโ€™s name. Each professor enters the app with his email and displays only his students.

OK.

Can you show us your current table structure, slice, and UX views ?
Screenshot are best.

Hi @AdministraCED_italy

Thank you for providing these details.

On your Slice, you may want to set a row filter condition:
[AMMINISTRATORE]=USEREMAIL()
Letโ€™s name this slice โ€œmyStudentAnswersโ€.
You may want to change the โ€œUpdate modeโ€ into Updates only, or Read-Only, or whatever you want in order to avoid accidental deleting.

And then, set your view RIPOSTE with โ€œFor this dataโ€: myStudentAnswers

Let usknow if that works for you.

I donโ€™t see any difference. I donโ€™t understand how I have to do to make sure that everyone only sees those of their own competence

I have two tables.
One where I have Name and email address, the second one is filled in by the various people through the other app. People who fill in from the other app indicate only the name, not the email address.
In this app, on the other hand, the various people who can use the app (ie those who are included in the โ€œadministratorsโ€ list) see only those where people have indicated their name.
I donโ€™t know if I have explained myself correctly.
Basically there should be a match between the name and email of the different administrators

Aurelien
Google Developer Expert
Google Developer Expert

Hi @AdministraCED_italy

You are correct on this point:

However, perfect match never exist.
This is why you may prefer using USEREMAIL() instead.

Similarly:

This is risky. If one student states its name is โ€œPaolo RUGGIERIโ€ and you have in your student table โ€œPaolo Ruggieriโ€, itโ€™s lost.
Furthermore, provided you have two student with the same name, you will meet another issue because you canโ€™t distinguish whoโ€™s who.

In my opinion, when it comes to identify people, everything should be based on user email.

About that:

you may want to set the email address as key, and set the name as label.
For users, they will only see names and never the address email.
That may be what you are looking for ?

Here is an example below:


For reference:

THANK YOU ALL, I SOLVED

Top Labels in this Space