Schedule a Daily Export of All Orders into a Google Spreadsheet

This workflow will export all orders placed on a single day into a unique Google Spreadsheet. This export can include whatever order data you desire. In this example, I will include the order number, customer email, total price, and total weight of the order. These properties will each occupy a column and each order will occupy its own row. This spreadsheet would look like this:

Follow the steps below on how to create this workflow.

1. From the Dashboard tab and from the Create your own workflow quick start, trigger this workflow for when a Shopify Order is Created.

2. In Step 2, add a Mesa Transform Mapping action to get the workflow started after an order is created. This Mesa Transform Mapping step will tell Mesa what information to put into your Spreadsheet. 

3. In the Mesa Transform Mapping Action, select the data you want to show in your spreadsheet. In my case, I want to show Order Number, Customer Email, Total Price, and Total Weight of the order in this spreadsheet. To add this data, add the name of the data you are mapping in the left column called Key. Then select the token of the data in the right column called Value.

4. Nice! Now we need to tell Mesa to gather all of the orders in a particular span of time and group them all together. To do so, we must use the Virtual Output step after the Mesa Transform Mapping step. Once you add this, adjust this step to your desired timeframe. In my case, I want this to gather all orders on a daily basis. 

5. Next, we need to create a new Google Drive Spreadsheet. To do so, add in the Google Drive Create Spreadsheet Action. Make sure that you select and create a Google Credential connected to your desired Google account.

6. Now that the credential is selected, it is useful to adjust the file name to be more specific. In this example, I adjusted mine to say "Order Export for {{date:now}}".   

7. Our last action will be to tell Mesa to insert the Mesa Transform Mapping Data into this spreadsheet. To do so, add in a Google Sheets Write Sheet Action. 

8. Next, make sure that you select a Google Sheets Credential connected to your desired Google account.

9. Now that the credential is selected, we will need to tell Mesa to create this sheet in our newly created Google Drive Create Spreadsheet. To do so, click into the Spreadsheet field, scroll down, and click Use Tokens. We can link this Action to the previous Google Spreadsheet Create Action.  

10. Now click to add the Spreadsheet ID from the Google Drive Create Spreadsheet, as a Token.

11. Almost there. Now we need to tell this step to populate this sheet with the data we collected in the Virtual Output step. To do so, add {{virtual_output}} into the Spreadsheet Rows field.  

Nicely done! This is what your completed workflow now looks like.  

Enable this Automation and save.