I’ve been spending quite some time trying to figure out how to make what I need for another project.
I’ve created a warehouse collection with 2 warehouses, and a cargo collection with 2 example items.
Each Cargo entry has a field for which Warehouse it is currently in, as well as its quantity, weight, and itemID
I display both warehouses on the screen at once for testing, but also selectable by a drop-down.
Each warehouse view displays a list of cargo assigned to that warehouse.
So for example both cargo items are in warehouse 1, and none in warehouse 2.
I then made a button to “move” the item from warehouse 1 to warehouse 2 by updating the cargo’s Warehouse field to the selected warehouse.
This works fine, however.
I also want to be able to transfer partial items, so for example having an entry with quantity 5 and weight of 100lbs. Say I only want to transfer a 3 of them at 60 lbs.
I can also do this, which I did with a Modal screen that pops up when you click a second arrow button (one is set for visibility if the entry has a qty of 1 and the other with a qty > 1)
Enter in the qty and weight and it then subtracts those values from the existing warehouse then CREATES a new entry in the other warehouse with the entered items.
Now where I am having trouble is figuring out how to put those items back in the original warehouse by combining them into the entry that already exists, NOT making a new entry.
I can’t figure out how to get the interactions right. Everything I try to do comes down to needing to be able to have multiple conditions on an action or visibility setting which currently isn’t possible with adalo.
Essentially I need it to check if that item already exists in the other warehouse, then add it to the existing entry if it does. I added a field called itemID which I just threw some manually entered random numbers in there to see if I could somehow be able to get it to check that value but I can’t…