Data for days when no refunds are processed

Hi there,
I’m pulling data for refunds from Shopify and trying to create a flow for checking dairy refunds.
We sometimes have days when no refunds are processed and in that case, this step doesn’t receive any data. however, I need to record daily refund data and send those to Googlesheet so I’m wondering is there any way to put 0 (instead of no data) when we don’t have refunds.

Thank you!

Hey @Akiko :wave:

These ones are tricky, but we have a workaround that should help. You’ll need to create a separate branch that will export to the same Google Sheet.

If there are no refunded orders within the selected timeframe, the top branch will export 0 to a column of your choice. The bottom branch will not export any rows. If you do have refunded orders, the bottom branch will export those orders. The top branch will not export any rows.

First, try refreshing your Shopify import. Even if there are no refunded orders, column headers should still be returned with 0 rows.

You’ll need to add 1 blank row by using an Insert rows step. Next, use the Insert text column step. Enter any unique name for your new column and set the value to 0. In this example, I named my column Test.

The Count by group step is the key ingredient here. Configure your settings to count the unique values in the Test column. If there are refunded orders, they will all be filtered out. Lastly, the Filter rows step will be used to Keep rows where Count is equal to 1.

You can use a Rename columns step to rename the Test column to the column you want to export in your spreadsheet. The Select column step will remove the Count column, so only the 0 value is exported to your desired column.

Hope that helps!


Thank you @daniel for the detailed explanations! It was really helpful. I could fix my flow.

1 Like