community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Preventing Errors for empty paths

Meteor

Hi, 

 

I have a complex workflow with many different macros that are then unioned together for output. The problem is that there is not always data for every macro, and when this occurs it creates an error because I use a dynamic rename for the headers in the macro.Therefore the default headers of "1", "2", etc. are not recognised fields. 

 

Error: MCRO_Get labels (894): Tool #14: The field "1" is not contained in the record.
Error: MCRO_Get labels (894): Tool #107: The field "2" is not contained in the record.
Error: MCRO_Get labels (894): Tool #109: Parse Error at char(13): Unknown variable "2" (Expression #1)
Error: MCRO_Get labels (894): Tool #165: The field "1" is not contained in the record.

 

It is possible to add a formula/macro to ensure that the key fields are added even where no data is present but I have a lot of macros and this seems tedious and time-consuming. 

 

Is there a quick way to avoid errors for unknown fields caused by no data passing through? 

 

The big issue is that the error prevents the rest of the data passing through the workflow due to it being linked to the union downstream. 

 

Thanks for any help!

Hi @jamesgough,

 

You can also incorporate the count records tool from Transform tab in combination with a Text Input tool from In/Out Tab with a single record of Header values when there is no data in the stream. 

 

Hope it helps. All the best!

Alteryx Partner

Hello @jamesgough ,

 

Have you consider the detour tools? You could use them for your case where:

 

Left path is used if all the needed fields are in your data.

 

Right path is used if there are missing fields

 

you would need to work around it but I think this could be useful.

 

Use the info tool to pass the list of variables as a parameter to the macro (need to be transposed to pass all at the same time), set the condition and update the detrour tool after.

 

I may be overcomplicating things but this is how I see it.

 

Cheers

Labels