Skip to content
Verified

Get Data

A saved, callable query that reads records through a datasource and hands them back to whoever called it.

A Get Data program is a saved read. Whether it is a form looking up one record, a grid pulling a filtered list, or a script fetching rows to compute something with, the read is a Get Data program: a datasource, a set of fields to return, and the lifecycle events that fire around the retrieval.

Properties

studio_meta.parentId defaults to programs (or a folder under it).

progDataSource

The full shape lives on the Datasource page. A Get Data program almost always sets dataSourceType: "table" plus either dataSourceFilterModelType: "index" for a single record or "query" for a filtered list.

progFields

progEvents

Get Data adds per-record events on top of the usual lifecycle:

Calling a Get Data program

From a workflow, the get_data action runs it. Parameters are matched by field id, each one either a static value or an fx expression:

json
{
  "id": "1", "data": {
    "action": "get_data",
    "name": { "prog": "97a_gtd_…", "properties": {}, "parameters": { "class_id": { "fx": "@glb_class_id" } } },
    "enabled": true
  }, "props": {}
}

Worked example

Point it at a table

dataSourceTableId names the target table; dataSourceFilterModelType picks index (one record) or query (a filtered set).

Declare what comes back

progFields entries of data.type: "table" return that column on every matching row; a virtual field is an input parameter instead.

Call it from a workflow

get_data with name.prog set to this program's id, name.parameters mapping caller values onto the program's virtual fields.

Create a Get Data node under Programs, set its Datasource tab (table, index or query, sort), then its Fields grid for parameters and returned columns.

xml
<meta lang="json5">
{
  id: "load_student_classes",
  menuTitle: "Load Student Roster"
}
</meta>

<params lang="json5">
{
  in: { campus_in: "string" },
  out: { student_entries_v: "array" }
}
</params>

<datasource lang="json5">
{
  type: "table",
  table: "student_profiles_table",
  filter: { mode: "query", queryField: "@campus_query_v" },
  output: "student_entries_v",
  direction: "asc",
  realtime: true,
  limit: 25
}
</datasource>
json
{
  "properties": { "menuType": "get_data", "menuName": "Load Students By Class", "runAt": "" },
  "progDataSource": {
    "dataSourceType": "table",
    "dataSourceTableId": "5b1_tbl_a953848a71c5",
    "dataSourceFilterModelType": "index",
    "dataSourceIndexId": "a1b2c3d4-…",
    "dataSourceSort": "STU_Full_Name",
    "dataSourceRealtime": true
  },
  "progFields": [
    { "id": "b2c3d4e5-…", "data": { "field_id": "class_id", "type": "virtual" }, "props": { "fieldType": "string" } },
    { "id": "c3d4e5f6-…", "data": { "field_id": "STU_Full_Name", "type": "table" }, "props": { "fieldType": "string" } }
  ]
}