I am trying to create a relationship between two databases that allow assets to be signed out like so:
Assets: RED BLUE GREEN
People: TOM SAM SARAH
Any asset can be signed to any person, but only once. I have managed to get the one-to-many working, but I can sign the same asset to TOM, SAM and SARAH at the same time. Once it is signed back in, it can be allocated to another person.
How would I go about setting up so once it’s assigned to someone, it disappears from the available list? Then reappears once it is returned?
In my current setup, I am working with people in a database, not logged-in users.
I have a list that displays people, you select one and it allows you to assign an asset to that individual, by adding the asset to the main database in an appropriate column, like this:
I don’t really understand a lot of the logic in Adalo yet, I’m used to writing expressions that are mathematically logical, so this is different for me.
Thanks for all your help =)
My next task is to get the assets returned at the end of the day, I’m halfway there, they can be removed with a single button, but they never reappeat in the list. I’m getting something wrong with the relationships I think, as they appear as ‘Untitled’ in the database if you use the delete function.
The issue appears to have been that using a Delete function on a Users Asset will delete the entire asset. It was appearing as Untitled because the database had no idea where the asset went.
Refreshing the page revealed the problem.
Is there a better way to clear the asset from a user with a single button press, instead of going through every dropdown and setting it back to ‘Select asset’?
Adalo documentation says that for 1:1 you just disregard the ‘many’ side of the relationship and consider to be ‘1’. In reality I don’t think it works as one would expect.