DATABASE List columns function

Get column metadata (name, type, nullable, default) for a table.

Help CentreBuilding Processes

This article describes the RPA Database functionality to list columns of a database table.

For a full list of available functions, please read DATABASE functions.


Description

The List columns function returns column metadata for a specified database table, including each column's name, data type, whether it is nullable, and its default value.


Setting it up

To use the List columns function, follow these instructions:

{{popups:rpas/add:action=db-list-columns}}

Once on a process map:

  1. Navigate to the process where you would like to add the List columns 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 columns 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 retrieve column metadata for
SchemaNoText-The schema the table belongs to
VariableNoTextcolumnsVariable name to store the column metadata

Output variables

VariableTypeDescription
{columns}Array of dictionariesColumn metadata, where each dictionary contains: name, type, nullable, default

Errors

ErrorDescription
Connection not foundNo open connection exists with the specified name
Table not foundThe specified table does not exist in the database

Tips

  • Use this action to validate table structure before performing bulk insert or import operations
  • The output can help you build dynamic queries based on available columns

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.