Help Centre › Building Processes
This article describes the RPA Database functionality to list tables in a database.
For a full list of available functions, please read DATABASE functions.
Description
The List tables function returns a list of table names in the connected database. You can optionally filter by schema to narrow the results.
Setting it up
To use the List tables function, follow these instructions:
{{popups:rpas/add:action=db-list-tables}}
Once on a process map:
- Navigate to the process where you would like to add the List tables 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 List tables 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) |
| Schema | No | Text | - | The schema to filter tables by (e.g. "dbo" for SQL Server, "public" for PostgreSQL) |
| Variable | No | Text | tables | Variable name to store the list of table names |
Output variables
| Variable | Type | Description |
|---|---|---|
| {tables} | Array of strings | A list of table names in the database |
Errors
| Error | Description |
|---|---|
| Connection not found | No open connection exists with the specified name |
Tips
- Use the schema parameter to filter results – e.g. "dbo" for SQL Server or "public" for PostgreSQL
- Combine with db-table-exists for conditional logic before creating or inserting into tables