I'm making an app that has multiple units where you can view the technology/machines associated with them. You can also edit the information, delete machines, and make logs for them. I'm using Excel data with a canvas app.
The user picks the unit, then the machine within the unit, and then they can view the information or edit it. So far, I've been able to get by with having the user pick their table first, which then causes the app to present information for that assigned variable throughout the rest of the app. (For example, a gallery is not assigned to a specific table, but assigned to a variable that changes depending on user input).
A part of OnStart looks like this:
Set(UnitChoice, table_newunit);
And an example of a command with a business unit (The user presses a button). OnSelect for a business unit looks like this:
Navigate('MACHINE SCREEN');
Set(UnitChoice, tb_axle);
tb_axle
is one of the business tables. This goes on for multiple tables, such as tb_rail
, tb_paint
, etc.
Now onto the problem. When you get to the 'MACHINE SCREEN', I wanted to give the option of deleting a machine.
I thought the remove function would be proper. I made a pop-up container, and it gives the user a confirmation dialogue for the deletion. Here's what I got:
Remove(UnitChoice, gallery_machines.Selected);
Refresh(UnitChoice);
Navigate(screen_success)
I get an error message that says the first argument should be a collection, so I'm guessing the variable trick won't work in this case? I wanted to make it simple, but I could 1000% do an IF statement for each unit based on what choice the user made. However there's enough tables to the point where that would be a bit of a hassle. I wanted this to be adaptable for when the users add more units. Any ideas would be greatly appreciated.