Conditional rule

I have in glide a list of employees by name and email,
I want in the application when i chooses the name, how can I make the email field to be filled in automatically.
And if I change the name, the email changes accordingly.

(II Think It is similar to the conditional rule, if A = Name, B = Email )

لقطة الشاشة 2021-10-11 055710
لقطة الشاشة 2021-10-11 055630

Take a look at Screen Values

1 Like

Yes, I know that, but what I meant is something different.
When I choose the name Anas it gives me Anas email automatically, and if I choose the name Ammar it gives me Ammar email automatically, and so on…

If you are selecting a name and it’s already attached to an email, why do you need another choice component for the email? If they have to match, why make the user choose from both instead of just choosing one (preferably name). It would be a lot simpler to pick from a list of names, but save the email value to the table, then use a Relation and Lookup to get the name and any other user info later.

I guess I don’t understand why you even have a choice component for the email if you are going to override it anyway, based on the chosen name.

Well, I have about 50 employees who use the app, Each employee will only see the customers he added in the app based on his email,

I, as an admin, sometimes transfer a customer from one user to another.
I have to edit the data and change the name and email of the user so that it appears to the other user.

If you change the name only, it will not appear to the other person…
For the safety of the error, the e-mail must be changed automatically when changing the name. Is there a safer way?

So are you saying that you have a list of customers, and for each customer, there are columns to store an employee name and email? At most I would only ever store the employee email in that customer sheet. You can use a relation and lookups to get the rest of the employee information from just that email.

If I understand correctly, you have an employee sheet with an employee name and the name is also duplicated on several customer records in a customer sheet. It not very good practice to duplicate data…especially when it can be properly linked in a relational database.

You should only need to change the email on the customer record and nothing else. A single choice component that’s set up to display names but store the email as the underlying value would be sufficient. Change one choice component to select a different employee and the relation and lookups will take care of the rest.

1 Like

Download the CRM template from the store. It does what you are trying to do. You just need to reverse the process from employee to customer to customer to employee. You find the customer , then assign customer to the employee you want. It is simpler.