Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Error with "Google Sheets Output" when trying to append zero rows

BigBart81
6 - Meteoroid

Hi

 

I have a small workflow which fetches every few minutes new data and appends it to a Google Sheet. But very often there are no new data and the workflow has nothing to write. In this case the Google Sheets Output throws an error.

Now my Workflow Results are full with error and it is a big mess to see, if there are any problems, or if it is just the problem with the Google Sheets Output. Has anyone a recommendation, how to solve this problem?

 

Couldn't find any Information about detour or disable a container with 0 rows or suppressing specific errors.

 

Any help would be very welcome.

2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus

Hi @BigBart81,

 

I've just tested this and confirm I get the same behaviour, here's how you could resolve the issue by using a batch macro and a container...

 

Step 1:

 

Take your Google Sheets output tool and create a simple macro, just with that tool and a macro input connected to it.

 

BenMoss_0-1616803031686.png

 

 

Step 2:

 

Place your Google Sheets tool in a tool container

 

Step 3:

 

Bring a control parameter tool onto the canvas and connect it to your tool container, which will create an 'action'

 

BenMoss_1-1616803244034.png

 

 

Step 4: 

 

We need to tell our action tool how we want to control the tool container, in our case, we want to disable the tool container when the value passed into the control parameter (count of our records) is 0.

 

The configuration window for our action tool should therefor specify that we want to 'update the value with formula' and we want to update the disabled flag...

 

BenMoss_2-1616803293407.png

 

Our formula would then be...

 

IF [#1] = "0" THEN "true" ELSE "false" ENDIF

 

i.e. if the value passed into the control parameter is 0 then disable the container (make the disabled flag true) else leave it enabled.

 

This fornula is given at the bottom of the action tool.

 

Step 5:

 

Save your macro

 

Step 6:

 

Bring your macro into your main workflow, you'll replace your current google sheets tool with your marco, streaming your data into the standard macro input (the one without the upside down question mark).

 

BenMoss_3-1616803550867.png

 

You'll then add a count records tool to the last step prior to your output, and pass the resulting value into the control parameter input anchor (the one with the upside down question mark).

 

The final step is to configure the batch macro to tell Alteryx which field from your count records output (there is only one) is the value you want to pass into the control parameter...

 

BenMoss_4-1616803646937.png

 

You do not need to make any changes to the default settings on the 'Group By' tab.

 

I hope this is useful, please let us know if you get stuck trying to implement this solution.

 

Ben

 

BigBart81
6 - Meteoroid

Thanks a lot for the great Solution.

Labels