Skip to content
Verified

Component datasource

Where a component, Get Data or Set Data program gets its records from, a table, a list, JSON, Csv, or none at all.

What a datasource does

A component can show information, repeat over a list, react to records, or need no data of its own. The Datasource tab is where you choose which.

DB Table

Choose DB Table when the component should use records that already belong to the app: customers, tasks, orders, bookings, or anything else stored in a table.

Pick a table, then a filter mode:

Query has three views: Builder, visual and the right starting point for most people, Mongo, and SQL, for people who already know those query styles.

Table datasource controls

Watch fields still needs an On refresh event

To react to the new data after a watched field changes, add an on_refresh event. Watch fields also re-fires screen_ready for components that have no on_refresh yet, but that fallback is deprecated: re-running create code over DOM that already exists duplicates whatever it built. See Component events.

Array, JSON and Csv

Each of these can come from a URL (GET, or POST when the request needs to send values first) or from Input, a fixed value placed directly into Studio, useful for a draft, a demo, or designing a layout before real data exists.

Use Test on a URL-based datasource before building the rest of the component around it, so a bad response gets caught early instead of late.

None

Choose None for a layout piece, a button, a static section, or anything that gets its data from somewhere else in the app, a caller's parameters, for example. None is only offered on components, APIs and batches.

Get Data and Set Data are narrower

A Get Data program can use DB Table, Array, JSON or Csv, but never None: it always needs a real source. A Set Data program is narrower still: DB Table is its only datasource option, Array, JSON, Csv and None are not offered.

Quick decision table