Paginated API GET

Call a custom API GET endpoint which returns a list, keeping all rows while a condition holds

Ingredient Family: rowActionsIngredients

Outline Display: Call the GET endpoint named {{endpoint}} of {{apiName}} with the mapping: {{mapping}}. Gather up rows so long as {{while}} remains True.

Details

A page that does not come back fails the action rather than aborting the page it was triggered from, and stops the walk: no further pages are asked for, and what earlier pages’ rows already did stands. If the api’s provider requires a login and no credential is connected for this caller in this context, the step fails with a not-connected message naming connecting the service as the fix, and nothing is sent. A page the api refuses with HTTP 401 or 403 fails as unauthorized (sign in to that service again); any other refusal, and a host that cannot be reached, fail as a malfunction. The mapping may be omitted when the row already carries the endpoint’s arguments under their own names: an argument no entry names is filled from the row’s column of that name, so a mapping spells only what it renames or computes. A file or point argument is never filled that way and always needs its own entry. Inside a tool’s row action an argument no column supplies is not an error: it becomes a new argument of the tool, described from the endpoint argument it feeds, so a name meant to match a column and missing it silently grows an argument the caller must fill. The outputMapping may be omitted too: left out, every output the endpoint declares is handed to the inner action and the while formula under its own name, with its declared type. Authored, it states its base: all: keeps that default and adjusts it (hide:, rename:, add:), and only: hands over exactly its entries (only: [] hands over nothing). An output whose name the row already holds (a tool argument, an earlier step’s output) is a duplicate-column error: hide or rename it under all:.

Local scope

The parent slot binds these (look up the slot in the parent to see how):

  • $table – The table to act on

Names introduced within this component’s knobs:

  • inputTable – request shape of endpoint (chosen under apiName)
  • outputTable – response shape of endpoint (chosen under apiName)
  • mappingResult – empty table populated by ingredients
  • NULL – empty table populated by ingredients
  • tempTable – empty table populated by ingredients

Settings

Required

  • apiName : API connection
    the API the endpoint is part of
    Set this to the name of any top-level api: item (or the inline api: block on a service/authenticator).

  • endpoint : endpoint of apiName
    the endpoint to send the GET request to
    Set this to the name of an entry under wrappedEndpoints: on the referenced api: item (which defaults to the endpoint it wraps), or to the name of a raw endpoints: entry that has no hand-written wrapper: every such endpoint automatically gets an identity wrapper of the same name (each parameter an argument, each response field revealed, with any character other than letters, digits, _, and - in a name replaced by an underscore, so the flattened path payload.note becomes payload_note). Do not write identity wrappers by hand; write a wrappedEndpoints: entry only to restrict or reshape an endpoint, and note that doing so replaces its automatic wrapper.

  • mapping : ingredient slot of mappingIngredientsList($table, mappingResult, inputTable) (many, until inputTable = mappingResult)
    How to map available field values to the endpoint’s inputs

  • while : formula (returns bool; required, non-nullable)
    While this formula remains true, keep adding rows from the endpoint to the table
    Scope: all columns of $table (reference as [ColumnName], e.g., [Name], [Price])

  • count : new column (type: integer; required, non-nullable)
    A name for a variable that contains the number of rows added.

  • retText : formula (returns text; required, non-nullable)
    A message to display to the user when the rows are added.
    Scope: all columns of tempTable (reference as [ColumnName], e.g., [Name], [Price])

Optional

  • outputMapping : ingredient slot of mappingIngredientsList(outputTable, $table, NULL) (many)
    How to map API outputs to values we care about. Left out entirely, every endpoint output is handed to the inner action under its own name. Authored, it states its base: all: (that default, with optional hide:, rename: and add:) or only: (exactly its entries; only: [] hands over nothing)

  • innerAction : ingredient slot of rowActionsIngredients($table) (many)
    The action(s) we will perform on each of the returned rows