Skip to content

SQL Table

The SQL Table card component is a powerful tool that fetches data directly from a database rather than from a MODLR Cube. Text elements must be used to display the fetched data.

Common Use Properties

Columns Property The number of columns in the table. Limit: 40

Query Property The SQL Query to be ran.

Query Parameters Property Only use if the SQL query entered in the Query Property is paramaterized with ?

  • Example: select * from financial_transactions where id = ?
    If so, then add as many items as there are ? parameters and enter the values accordingly (in order of ? appearance).

Datasource Property The database to run the query in.

Row Limit Property The maximum number of rows to be displayed.

SQL Formulas to fetch Data in Text Components Once an SQL table has been created there are several formulas that can be used within text elements to fetch data from the table.

  • SQLCOLUMNNAME(column): Returns the name of the field for the specified column index in a cards SQL Table component.
  • SQLROW(): Returns the entire row as a comma-delimited string in a cards SQLTable component.
  • SQLCOLUMN(column): Returns the column value of the current row in a cards SQLTable component. The column argument can either be the column index or the name for the current row.
  • SQLVALUE(row, column): Returns the value of a specific column from a specific row in a cards SQL Table component.