When using Google Sheets as output and there are occasionally 0 records write I get error:
"Error trying to publish spreadsheet: HTTP/1.1 400 Bad Request"
Is there any way to skip output to connector if no records?
Thanks!
Solved! Go to Solution.
You can use a stop until done tool and branch off to count records first. Then if records = 0 have an error message tool attached. Set the workflow settings to stop workflow on error and that should skip second flow that outputs to the google sheets connector.
Thank you for sharing, apologies for not being more specific but looking for a solution that doesn't result in any errors.
Does your solution trigger errors? (Appears so upon review but not 100% certain)
Apologies - my solution does produce an error because that stops the flow - you could launch a detour if the count = 0 to take down a separate flow that ends with nothing. With more thought i think this would then need to be an app to update value.
Sounds like a great time to use Alteryx's new Control Containers: https://help.alteryx.com/20231/designer/control-container-tool
the traditional way to do this is to drop your google sheet tool into a macro. add the record count as mentioned by @ed_hayter - have the macro after a filter testing if Record count >0.
Thanks, tried looking at the tool example and forum posts but couldnt figure that out. If you have any relevant links to steps thatd be greatly appreciated!
Basically in the first control container you want your test and your output. Then from the count records test you want that connected to a filter outside the control container and linked to two different control containers at their input anchors. Within those two paths you want one with just a browse tool (no output) and one that connects to google sheets (this one should be connected to the filter test where count is not 0).
The tools in the control container branches should be connected up to your output within the first control container.
The set up in my flow for the second response is configured correctly it just needs a google connector for the false anchor control container. I had two examples in the flow one which goes down the 0 records route and one that goes down the output route.
We struggled with this same issue for a long time and worked with Alteryx support on it. Crucial for us was that no error is returned.
You should take a look at the Google Drive tool instead. Getting the connection set up properly in the first place is more difficult, but you should be able to avoid the error condition.