Is it possible to send data to a specific sheet in a google spreadsheet based on a variable in the data SELECT(ed)? In the example below would it be possible have the zap place the data in a sheet based on what order_extra_val_4 is. For example: if order_extra_val_4=Session_1 the zap would either place the data in the sheet labeled Game_1 or would create a sheet named Game_1 and place the data in that sheet?
On top of that would it be possible to make the 'Friday Session 1: Level 5 Junior A & B Senior A' dynamic?
Right now I am having to create as many zaps as there is sessions(sheets) and changing the code based on the session(ms_orders.order_extra_val_4 = 'Friday Session 1: Level 5 Junior A & B Senior A')
SELECT order_id, order_extra_val_1, order_extra_val_2, order_extra_val_3, order_extra_val_4, order_extra_val_5, order_notes, order_total FROM ms_orders
LEFT OUTER JOIN ms_cart
ON ms_orders.order_id = ms_cart.cart_order
WHERE ms_cart.cart_pic_date_org = '2021 Level 3-4-5 State Meet' AND ms_orders.order_extra_val_4 = 'Friday Session 1: Level 5 Junior A & B Senior A'
Best answer by nicksimardView original