-
Hello, New to the world of Totum, I'm stuck on an issue — likely obvious to you — for which a tip would be helpful. I have three tables. In a simplified manner, it looks like this: User [id, name] The idea is to track my equipment inventory and know who owns what. I would like to add a column in the "Device" table that displays the name of the person currently using it. In essence, in SQL, I would do: SELECT User.name
FROM Device
LEFT JOIN Attribution on Device.id = Attribution.device_id
LEFT JOIN User on User_id = Attribution.User_id
WHERE Device.id = #id
AND Attribution.date_end = NULL I assume I should use a Could someone help me out? Thank you ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! in your case you can use simple "Select" function in Code section in Device table:
also you should recalculate Device table manually or automatically. For example in action code on add, edit and delete in Attribution table (field device_id):
|
Beta Was this translation helpful? Give feedback.
Hi! in your case you can use simple "Select" function in Code section in Device table:
= : select(table: 'attribution'; field: 'user_id'; where: 'device_id' = #id; where: 'date_end' = ""; )
also you should recalculate Device table manually or automatically. For example in action code on add, edit and delete in Attribution table (field device_id):