Hello guys,
I'm stuck because after 2 days I still don't get how to send correct data to my append gsheet query to create new data in my gsheet.
I've a form with 2 inputs. First input is a number field named ​price_input and the second one is a select field named ​current_asset. The select field is mapped by a gsheet query named "getAssets" and each asset has several properties like
{Id, name, market, quantity}. In my select I use only id for the value and name for the label.
So on submitting the form in my append query I need all the props in the asset item and the price value as well.
Basically I've to create a new object ​by collecting the props of my current ​selected item in the select input and ​and the​ the value of ​the price in ​the number field.
Something like this
{​id, name, market, quantity​​, price}.
​To achieve that ​​I could use .find()
like
const asset = getAssets.data.find((i) => i.isin === current_asset.value);
return {
...asset,
price: price_input.value,
}
​I would like to make this object available in my appending gsheet query.
How can I achieve it? What is the correct approach?
​Many thanks for any kind of help