Best answer

MYSQL lines to a certain sheet in google sheets based on variable.

  • 7 April 2021
  • 2 replies
  • 20 views

Hello,

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'

icon

Best answer by nicksimard 27 April 2021, 03:03

Hi @jfreeman1412!

This one is a little tricky, because it will require a couple of more advanced Zapier workflows. 

The first is Lookup Table, where you specify which value to look for and then what to output depending on what is seen in that field.

The next is dynamically setting Google Sheets (spreadsheet and worksheet) custom values, which you can read about here:

I’d say reading through those materials will give you a good idea of whether your desired workflow will be possible :)

If you have any other questions (again, these are pretty advanced techniques) please don’t hesitate to ask here!

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +10

Hi @jfreeman1412!

This one is a little tricky, because it will require a couple of more advanced Zapier workflows. 

The first is Lookup Table, where you specify which value to look for and then what to output depending on what is seen in that field.

The next is dynamically setting Google Sheets (spreadsheet and worksheet) custom values, which you can read about here:

I’d say reading through those materials will give you a good idea of whether your desired workflow will be possible :)

If you have any other questions (again, these are pretty advanced techniques) please don’t hesitate to ask here!

Userlevel 5
Badge +8

Hey @jfreeman1412,

Did Nick’s suggestion help here? We’d love to know if you were able to get this sorted out.

If you still need some help please let us know!