Help Centre › Building Processes
This article describes the RPA File functionality to validate a file's format.
For a full list of available functions, please read FILE functions.
Description
The FILE Validate file format function checks if a file is valid for its format. The format is auto-detected from the file extension, or you can specify a format explicitly.
Setting it up
To use the FILE Validate file format function, follow these instructions:
{{popups:rpas/add:action=is-valid-file-format}}
Once on a process map:
- Navigate to the process where you would like to add the FILE Validate file format function
- Open the Activities sidebar panel
- Under Document Processing > Validate, drag "Validate file format" onto the canvas
- Configure the file path and optionally select a specific format
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| File | Yes | Text | - | Path to the file to validate |
| Format | No | Select | Auto-detect | Explicit format to validate against (csv, docx, json, pdf, xlsx, xml, png, jpg, bmp, tiff, webp, gif) |
| Variable | No | Text | valid | Variable to store the result (true/false) |
| CSV delimiter | No | Select | Comma | Delimiter for CSV validation |
Output variables
| Variable | Type | Description |
|---|---|---|
| {valid} | Boolean | true if the file is valid, false otherwise |
Errors
| Error | Description |
|---|---|
| File not found | The file does not exist |
Tips
- If no format is specified, the format is auto-detected from the file extension
- Use this before processing files to prevent errors from corrupt or invalid files
- Combine with a Decision step to branch based on the validation result