Hi, i’am new on Glide but this looks fantastic !
I’m reaching out to inquire about the possibiity to add a new function in my app.
This is an app to manage devices linked to users.
I have a table for users and a table for devices. Within the layout, i can attribute devices to a given user. Using the “relation” function, my table with all users automatically updates with the list of attributed devices.
What would like to do now, is when i remove a given user (raw), to set devices as “available” automatically. In the present form 'Available" is in the user list. Is there any way to proceed ?
Thank you very much.
Tristan
Could you provide screen shots of both tables please?
I’d like to see and understand how they are being related.
Thanks for your help.
Here are the tables.
Regards
How do you know which device belongs to which user?
I can’t see any column value that both tables have in common.
In “dispositifs” table, the column (utilisateur) is defined within the app using the menu, where the list is from the table “Utilisateurs” column “Name”. By choosing a user, the column “utilisateur” in “dispositif” table updates with the name.
Here is another set of screen were device T01 is attributed to 01SEFMA1.
The column “matériel en prêt” in “utilisateur” table is in relation with “utilisateurs” table and automatically display all devices with UserName.
I see. And so when you delete a user, you want to clear any related columns in the device table, yes?
The way you have this setup is a little odd. But anyway, lets try and work with what you have.
Firstly, the only way to update multiple rows at once is to either use the Glide API, or use server side workflows. Both of those require a paid plan. I’ll assume you don’t have a paid plan, so will rule those options out.
You could do something like the following:
- In your Device table, create a relation that matches the user name with the user name in the users table. If that relation is empty, that means there is no user associated with that device.
- Create an if-then-else column:
– If relation is not empty, then User Name
– Else Unassigned
Then use that if-then-else column to represent device ownership/assignment.
2 Likes
You got it ! Thanks for the suggestion, i will try and get in touch.
Dear Darren Murphy,
What you’ve suggested works very well ! Thank you very much !
The only things that is not cleaned is the user name I selected within the App. Is there any way to directly attribute a device to a user without updating the “device” table and then applying what you’ve suggested ?
Anyway,
Thanks a lot for your kind support,
Regards
If you have a users table, you can have a multiple choice component that allows you to write a list of devices ID.
Then, use split text to split that list to an array, and a relation to link that array to the the devices table.
That way, you can display a list of components that belong to a user, in the users view.
On the devices table, create a reverse relation using the rowID (or whatever you decide to write in the choice component above), back to the split text column in users table. You will know which user is assigned the device.