- Goal: I am trying to build an order page, where the End User selects a product and then it can be added to a cart.
- Steps: I currently have a select that displays data from a retool database, specifically a description, and retrieves the "code" (part number) from the same database on selection. I then have a button which runs the following when clicked:
const id = CreateOrder_NewProductSelect.value;
const quantity = CreateOrder_NewProductQuantityInput.value;
const itemIndex = getProducts.data.id.indexOf(Number(id))
const title = getProducts.data.title[itemIndex]
createOrderCart.setValue([{ id, title, quantity }, ...createOrderCart.value]);
What I am trying to achieve is the ability to send any of the data from the database after its been chosen in the select to the "cart"