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

Alteryx designer Discussions

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

How to tell if a file doesn't contain the data I need.

Atom

I have built an alteryx work flow that processes xml files in a directory and it iterates through them fine using the wildcard when the xml schema is correct on the input tool, however some of the files do not meet the defined schema and I need to figure out a way to determine if the file is worth processing or not before the input tool.

 

Normally the file will look something like this...

 

<?xml version="1.0" encoding="UTF-8"?>
<Vehicle>
  <VIN>5A3AA87A6389745</VIN>
  <DecodeVIN type="boolean">true</DecodeVIN>
  <ClientField1>my cars.com</ClientField1>
  <ClientField2>5112228</ClientField2>
  <ClientField3 type="integer">94</ClientField3>
  <PrivateBookValue type="integer">1111</PrivateBookValue>
  <PrivateDate1>2018-10-11</PrivateDate1>
  <PrivateDate2>2018-10-14</PrivateDate2>
  <AuctionAssignment>
    <AuctionID>1234</AuctionID>
    <PickupOrDropOffNote>get car</PickupOrDropOffNote>
    <DropOffDate>2018-10-11</DropOffDate>
  </AuctionAssignment>
</Vehicle>

 

However, I am receiving some files like this and I am not able to stop these files from coming.

 

<vehicle><vehicle>

 

How can I tell the workflow to not try and process the files that look like the second sample and simply move on to the next file?

 

Thank you in advance for any ideas you might have.

Alteryx Certified Partner
Alteryx Certified Partner
This may not be the most robust method but it's certainly the simplest.

Use the directory input tool to return a list of all files in said directory, this also gives additional detail on dates and most importantly in this case, file size.

You could filter to only keep files above a certain size (or exclude those that are a very specific size).

Then pull only the remaining files into Alteryx with the dynamic input tool.

Ben
Labels