DATABASE Check if table exists function

Check whether a table exists in the connected database.

Help CentreBuilding 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:

  1. Navigate to the process where you would like to add the Check if table exists function
  2. Click on the green button's drop-down (right side of the green button labelled "Process")
  3. On the menu that appears, click on the "+ Activity" item
  4. From here you can select the Check if table exists option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
NameYesText-The alias of a previously opened connection (from db-connect)
TableYesText-The table name to check for
SchemaNoText-The schema to search within
VariableNoTextexistsVariable name to store the result

Output variables

VariableTypeDescription
{exists}BooleanTrue if the table exists, false otherwise

Errors

ErrorDescription
Connection not foundNo 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

Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.