A common issue that I run a cross every few months is where I have to create a workflow that requires an XLSX output whether or not there is data.
For example, there is an input data source that may or may not have data. Every time the workflow runs, there must be an XLSX output with the same column titles. There may or may not be data in the columns, but the column titles must be the same.
Every time I run across this issue, I use a different combination of Alteryx workflow tools for a solution. So, I know there are countless ways to accomplish this issue.
What is the best practice for this scenario? Does anyone have a go-to solution?
My go to solution is to have the test tool check for records and the message tool. If there aren't any records downstream I print out a message. I also have a text input tool with the column names in both headers and first row. I then union both and the XLSX output should print out the message and the empty columns.
This is quite a complicated solution, I am sure you have more straightforward solutions, but these are my 2 cents.
Hello, @Brian_Stoffel. You may need to elaborate and/or show an example. I know the Output Data tool will write to Excel even if there are only column headers in its input. If it's something different, then it may require some other tools such as Union, Dynamic Rename, etc. The Count Records tool is a macro. It includes a way to accommodate for no records. Perhaps this is similar to what you need.