Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Error handling

jor-di
7 - Meteor

Hi everyone,

 

I have a question regarding error handling. In my current workflow, I input many different excel files. In these files, I look for a keyword through the "contains" formula. After the search, the first row in the result data will be selected with the select tool.

 

Some of the files do contain the keyword, where others do not. Now, when the keyword does not exist in the file, I get an error that the select tool can not find the first row (which is logical as there is no output data in that case). However, I still want my workflow to continue, as it should still output some data to an excel file in my output tool. The problem is that the whole workflow stops running and no file will be written to my computer instead. 

 

How can I make sure the workflow continues either way?

 

Thanks!

3 REPLIES 3
jor-di
7 - Meteor

(What I described, is just a small part of the complete workflow, but relevant as it impacts the rest of the flow)

T_Willins
14 - Magnetar
14 - Magnetar

Hi @jor-di,

 

Which tool are you putting the formula in?  If you use the Contains formula in a Filter tool it should not error.  Without seeing your workflow, I would recommend using Sample or Select Records tool to get the first row of each file, then use the Filter tool with the contains formula to only get the rows you want.

danilang
19 - Altair
19 - Altair

hi @jor-di 

 

You can use a technique similar to this 

 

w.png

This is strategy used to ensure that there is always at least one record coming out of the final Select tool.  In the NoRecordsFound input, add a value to a text column with the same name as the first text column in your input.  After the next union, you'll always have either your records+NoRecordsInput or just the single NoRecordsInput row.  After appending the record count the filter passes either just your records if the count is greater than one or the NoRecordsInput if the count = 1.  In either case, you've always got at least one record.

 

This technique is usually used to add a "No Records Found" message to an output table if necessary, but you should be able to adapt it to your needs 

 

Dan

Labels