Skip to content

Lesson 3 ยท Input and Output Data

Connecting to Files with the Input Data Tool

Use the Alteryx Input Data tool for CSV, Excel and other files, control field names and record limits, read many files at once and avoid common type problems.

Almost every workflow begins by reading data. The Input Data tool (in the In/Out category) connects to files and databases. The settings you choose here affect everything downstream, so spend a few minutes on them.

This lesson covers files. Databases and in-database tools come two lessons later.

Choosing a file

Drag Input Data to the canvas, then pick a file or a connection in the Configuration window. Designer supports many formats, including delimited text such as CSV, Excel workbooks and its own database format, .yxdb. The list of formats depends on your version.

For Excel, you also choose a sheet or a named range. Keep input sheets as plain tables: one header row, no merged cells and no totals mixed into the data.

As of version 2026.3, Designer no longer includes 32-bit components, and reading old .xls files requires the 64-bit Microsoft Access Database Engine driver. Converting such files to .xlsx avoids the problem.

Settings that matter

After you pick a file, the Configuration window shows options that depend on the format. Look for these:

  • First row contains field names (or the similar Excel option "first row contains data"). If this is wrong, your header becomes a data row, or your first record becomes the column names.
  • Delimiter for text files: comma, semicolon, tab or something else. Many countries use semicolons because the comma is the decimal separator.
  • Encoding (code page) for text files. If accented letters look broken, the encoding is wrong.
  • Record limit to read only the first rows while you build. Set it back before the real run. Check the help for what special values such as zero mean in your version.
  • Field length for text. Values longer than the limit are cut off.

Why CSV types surprise you

A CSV file contains only text. Designer therefore reads delimited-file columns as text by default. A column of numbers is still text until you convert it.

Python Stand-in: CSV values are text until you convert them

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the zip code. If you convert 02134 to a number, you lose the leading zero. Keep identifiers, postal codes and account numbers as text. Convert only columns you will calculate with, using the Select tool.

Reading many files at once

Teams often receive one file per month or per store with the same layout. You have several options:

  1. Wildcard path. In the file path, you can use a pattern such as sales_*.csv to read matching files together. All files need the same structure. According to the help, a file that does not match the first one read can be skipped with a warning, so check the messages and the record count.
  2. Directory + Dynamic Input. The Directory tool lists files in a folder with their names, paths and dates. You can filter that list (for example, to keep this year's files) and pass it to Dynamic Input, which reads them.
  3. Batch macro. For files whose layouts differ, a batch macro can process each file on its own.
flowchart LR
  A["Directory"] --> B["Filter<br/>keep wanted files"]
  B --> C["Dynamic Input<br/>read each file"]

Build the file list first, then read the files in that list.

Turn on the option that adds the file name as a field when you read several files. Without it, you cannot tell which file a bad row came from.

Worked example: checking a new file

Whenever you meet a new source, check it before you build:

Check How
Record count Compare with the source system or the file's line count
Column names Look for extra spaces and duplicate names
Types See which columns are text but should be numbers or dates
Empty values Browse the data profile
Strange rows Look for totals, footers or repeated headers
Python Stand-in: a quick input quality check

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Paths: absolute or relative?

A path such as C:\Users\ana\Desktop\sales.csv works only on one computer. Prefer a relative path to a folder that moves with the workflow, or a shared location everyone can reach. You can also build paths with the [Engine.WorkflowDirectory] constant, which points to the folder of the saved workflow.

Excel pitfalls

Spreadsheets are made for people, so they often break the rules of a table. Watch for these:

Problem in the sheet What happens What to do
Title rows above the header Wrong column names Remove them, or start reading at the right row if your options allow
Merged cells Empty values below or beside the merge Unmerge at the source, or fill down in the workflow
Subtotal rows Amounts are counted twice Filter them out and report it to the owner
Mixed types in a column Conversion problems Read as text, then convert and check
Renamed sheet The input fails Agree on a stable sheet name

If you control the source, ask for a plain data tab. It is cheaper to fix a template once than to patch every workflow that reads it. If you do not control the source, put all the repair steps directly after the input, inside one Tool Container with a clear label, so the rest of the workflow can assume clean data.

Practice task

Make two small CSV files with the same columns, then add a third in which one column is named differently. Include an identifier with leading zeros and an amount that contains text in one row.

Write down the record count you expect. Read the files, add the file name as a field and apply your input checks. Note what happens with the third file in your version, and decide whether the workflow should stop, rename the column or set the file aside. Record the rule in an annotation next to the input.

Common mistakes

Never use a record limit while you check totals. A forgotten limit silently produces a small, wrong result.

  • Leaving the header option wrong, which shifts every row.
  • Converting identifiers to numbers.
  • Reading a file that another person has open and is still editing.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which type do CSV columns normally have when first read?

    A CSV file holds only text, so you set the types yourself.
  2. 2. Which pair of tools lets you list files in a folder and then read the selected ones?

    Directory produces the list, and Dynamic Input reads the listed files.
  3. 3. Why keep a zip code as text?

    02134 would become 2134, which is a different identifier.
  4. 4. What is the risk of a forgotten record limit?

    The run succeeds but includes only part of the data.

Summary

  • Input Data reads files and databases; check header, delimiter, encoding and record limit.
  • CSV values arrive as text; convert only what you calculate with.
  • Read many files with a wildcard, or with Directory plus Dynamic Input.
  • Check record counts, types and strange rows for every new source.

Next: Output Data and Alteryx File Formats

Your progress is saved in this browser. No account needed.