Hi, I’m very new to the Glide Community, I’m working on an app where I have clients and an admin.
I would like the client to see only their products (I have made the email column the rowOwner in each table and they already see their products) and I have an admin who needs to see everything that the other clients have.
I can’t achieve this last part. I have put the admin’s email in the table and made it the rowOwner, and I have also used the defaultValue property in the form to insert the admin’s email when creating a new row. However, since I already have the client’s email as the rowOwner in the same table, it puts the client’s email in the admin’s email column.
Does anyone have a better idea? Could it be that I need to create a table with query columns? Are there any videos that can help me with this?
Thank you very much in advance.
Don’t us On Submit for this. You are effectively creating a row with no owner, then trying to update it afterwards but you can’t update a row you don’t own. Your set column action does nothing because you are trying to update a row you do not yet own. Instead add a Special Value component to the form to get the signed in user’s email. Then for the admin email, you may be able to use the on submit set column action, but I generally don’t trust it. If you have the admin email in the user’s user profile, then you can add a User Profile component to to pass the admin email through the form. Another option is to create an entry component with a default value set to the admin email, and then hide it with visibility conditions.