DATABASE List tables function

List all table names in the connected database.

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

  1. Navigate to the process where you would like to add the List tables 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 List tables option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
NameYesText-The alias of a previously opened connection (from db-connect)
SchemaNoText-The schema to filter tables by (e.g. "dbo" for SQL Server, "public" for PostgreSQL)
VariableNoTexttablesVariable name to store the list of table names

Output variables

VariableTypeDescription
{tables}Array of stringsA list of table names in the database

Errors

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

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.