Using Array to Restock Inventory

Last week, during Office Hour, Gio and Kailey helped me create an interactive table with select buttons to create an array of parts to be restocked to inventory. I’ve been successful in setting this up and now I need to add the functionality to:

  1. Undo a selected part if the user adds the wrong part to the array (Kailey mentioned this during the session)

  2. Change the quantity of the amount of inventory being returned to inventory (example: The BOM calls for 12 snaps. Two snaps are attached to the failed product and the remaining 10 snaps can be restocked.)

Here is a photo of my interactive table on the left and the array that is populated when I select rows in the interactive table on the right.

hello @velogirlrides, we can certainly help out here!!

would you like to always remove the element in the Array that was added last?? if so, you could use logic similar to this (get Array Length, and remove the last one):

result (before and after clicking Remove button several times):

this is a little more challenging to explain without more information on how your Array is setup. however, something like this should work well. essentially, storing the last element in a Variable, and modifying a specific item in that Element (subtracting 2 in this example):

did I understand your questions correctly?? thanks for posting!!

For issue #1, “undo a selected part” - the solution that you offered seems viable.

For issue #2, “adjusting quantity to restock to some number other than usage defined by the BOM”- the number used in the ‘Changed Input’ equation (in the example, it’s 2) would need to be defined for each part in the array with user input. I’m not sure how to make this work.

great to hear @velogirlrides!!

have you considered adding a Number Input (of type integer) that allows the user to input the quantity that they’d like to subtract by?? you can then use that Variable instead of the static number (as I shared in the example). this would only change the quantity for the last element in the Array however.