Help Centre › Building Processes
This article describes the RPA Database functionality to check whether a table exists.
For a full list of available functions, please read DATABASE functions.
Description
The Check if table exists function checks whether a specified table exists in the connected database. This is useful for conditional logic before creating tables or inserting data.
Setting it up
To use the Check if table exists function, follow these instructions:
{{popups:rpas/add:action=db-table-exists}}
Once on a process map:
- Navigate to the process where you would like to add the Check if table exists function
- Click on the green button's drop-down (right side of the green button labelled "Process")
- On the menu that appears, click on the "+ Activity" item
- From here you can select the Check if table exists option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Name | Yes | Text | - | The alias of a previously opened connection (from db-connect) |
| Table | Yes | Text | - | The table name to check for |
| Schema | No | Text | - | The schema to search within |
| Variable | No | Text | exists | Variable name to store the result |
Output variables
| Variable | Type | Description |
|---|---|---|
| {exists} | Boolean | True if the table exists, false otherwise |
Errors
| Error | Description |
|---|---|
| Connection not found | No open connection exists with the specified name |
Tips
- Check before CREATE TABLE or INSERT operations to avoid errors
- Use in combination with conditional logic to create tables on first run