Knack

App · Databases · 18 actions

Create, find, update and delete records in a Knack app, submit its forms and upload files, with the app's API key.

Actions

ActionWhat it does
Count recordsCount an object's records, all of them or those matching a rule.
Create a recordCreate a record in an object.
Delete a recordDelete a record permanently.
Delete a record through a viewDelete a record through a table, list, search, calendar or details view that has a delete link.
Find or create a recordReturn the first record whose field equals a value, or create one with that value (plus any other fields) if none exists.
Get a recordFetch one record by its id.
Get a record from a viewFetch one record as a view shows it.
List fieldsList an object's fields with the field_N key each one uses in records, its type and, for choices, its options.
List objectsList the app's objects (tables) with their keys and record counts, read from the app's published schema.
List recordsReturn one page of an object's records.
List records in a viewReturn one page of records exactly as a table, list, search or calendar view shows them, with only the view's fields.
List viewsList the app's pages and the views on them, with each view's type, object and whether its page needs a login.
Log in an app userCheck an app user's email and password and return their record id and user roles.
Search recordsFind an object's records matching a field rule, optionally combined with more rules in Knack's filter format.
Submit a formCreate a record through a Form view, running the form's record rules (emails, connected updates).
Update a recordChange some of a record's fields.
Update a record through a viewUpdate a record through an edit form, or a table or search view with inline editing on.
Upload a fileUpload a file or image to the app.

Count records

Count an object's records, all of them or those matching a rule. Uses one API call.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Filter fieldfield_keytext
The field to filter on.
Operatoroperatortext
How to compare. Blank checks, 'is any' and the 'today' / 'current time' operators need no value.One of: is, is not, contains, does not contain, starts with, ends with, is blank, is not blank, is any, higher than, and 15 more. Default: is.
Valuevaluetext
The value to compare with. To match a connected record, use the connection field with 'is' and the connected record's id. Dates use the field's own format, such as 09/24/2026.
Range amountrange_amountnumber
For 'is during the previous/next', 'is before the previous' and 'is after the next': how many units, such as 3.At least 1.
Range unitrange_unittext
For the 'is during ...' operators: the unit, such as days, weeks, months or years.
Advanced filters (JSON)filtersobject
Optional extra rules in Knack's filter format, such as {"match": "or", "rules": [{"field": "field_1", "operator": "contains", "value": "Ltd"}]}. Combined with the rule above.
Matchmatchtext
Whether records must match all rules or any rule.One of: and (All rules), or (Any rule). Default: and.

Outputs

object_keytext
total_recordsnumber
Example output
{
  "object_key": "object_1",
  "total_records": 12
}

Create a record

Create a record in an object. Fields left out get their default value. Form record rules do not run.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
FieldsfieldsobjectRequired
The new record's values. Fill in the fields to set and leave the rest blank. Name, Address, Email and Link values take JSON such as {"first": "Ada", "last": "Lovelace"}; a connection takes a list of record ids; a file or image field takes the id from 'Upload a file'; Yes/No takes true, false or kn-blank to clear it.

Outputs

A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').

idtext
The record id.
Example output
{
  "field_1": "Acme Ltd",
  "field_2": "Customer",
  "field_3": 42,
  "id": "575482d691e16d4235adcdb6"
}

Delete a record

Delete a record permanently.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Record IDrecord_idtextRequired
The record to delete. A Builder URL containing the id also works.

Outputs

deletedtrue/false
idtext
Example output
{
  "deleted": true,
  "id": "575482d691e16d4235adcdb6"
}

Delete a record through a view

Delete a record through a table, list, search, calendar or details view that has a delete link.

Inputs

Pagescene_keytextRequired
The page (scene) the view is on, such as scene_1.
Viewview_keytextRequired
A view with a delete link.
Record IDrecord_idtextRequired
The record to delete. A Builder URL containing the id also works.

Outputs

deletedtrue/false
idtext
Example output
{
  "deleted": true,
  "id": "575482d691e16d4235adcdb6"
}

Find or create a record

Return the first record whose field equals a value, or create one with that value (plus any other fields) if none exists.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Match fieldmatch_fieldtextRequired
The field to look the record up by, such as an email.
Match valuematch_valuetextRequired
The value that field must equal.
Fields if createdfieldsobject
Other values to set only when a new record is created. The match field is set for you. Fill in the fields to set and leave the rest blank. Name, Address, Email and Link values take JSON such as {"first": "Ada", "last": "Lovelace"}; a connection takes a list of record ids; a file or image field takes the id from 'Upload a file'; Yes/No takes true, false or kn-blank to clear it.

Outputs

createdtrue/false
recordobject
A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').
Example output
{
  "created": false,
  "record": {
    "field_1": "Acme Ltd",
    "field_2": "Customer",
    "field_3": 42,
    "id": "575482d691e16d4235adcdb6"
  }
}

Get a record

Fetch one record by its id.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Record IDrecord_idtextRequired
The record's id. A Builder URL containing the id also works.

Outputs

A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').

idtext
The record id.
Example output
{
  "field_1": "Acme Ltd",
  "field_2": "Customer",
  "field_3": 42,
  "id": "575482d691e16d4235adcdb6"
}

Get a record from a view

Fetch one record as a view shows it.

Inputs

Pagescene_keytextRequired
The page (scene) the view is on, such as scene_1.
Viewview_keytextRequired
A table, list, search, calendar, details or edit form view.
Record IDrecord_idtextRequired
The record's id. A Builder URL containing the id also works.

Outputs

A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').

idtext
The record id.
Example output
{
  "field_1": "Acme Ltd",
  "field_2": "Customer",
  "field_3": 42,
  "id": "575482d691e16d4235adcdb6"
}

List fields

List an object's fields with the field_N key each one uses in records, its type and, for choices, its options.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.

Outputs

fieldslist
object_keytext
object_nametext
totalnumber
Example output
{
  "fields": [
    {
      "key": "field_1",
      "name": "Name",
      "read_only": false,
      "required": true,
      "type": "short_text",
      "unique": false
    }
  ],
  "object_key": "object_1",
  "object_name": "Companies",
  "total": 1
}

List objects

List the app's objects (tables) with their keys and record counts, read from the app's published schema.

Inputs

None.

Outputs

application_idtext
application_nametext
objectslist
totalnumber
Example output
{
  "application_id": "5d79512148c4af00106d1507",
  "application_name": "Customer Portal",
  "objects": [
    {
      "display_field": "field_1",
      "field_count": 3,
      "is_user_object": false,
      "key": "object_1",
      "name": "Companies",
      "record_count": 12
    }
  ],
  "total": 1
}

List records

Return one page of an object's records.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Records per pagerows_per_pagenumber
How many records to return, 1-1000.From 1 to 1000. Default: 25.
Page numberpagenumber
Which page of results to return, starting at 1.At least 1. Default: 1.
Sort by fieldsort_fieldtext
The field to sort by. Leave blank for Knack's default order.
Sort ordersort_ordertext
Ascending or descending, when a sort field is chosen.One of: asc (Ascending), desc (Descending). Default: asc.
Value formatformattext
Raw gives structured values (best for later steps), HTML the formatted text Knack displays, Both gives field_N as HTML and field_N_raw as raw.One of: raw, both, html. Default: raw.

Outputs

current_pagenumber
recordslist
total_pagesnumber
total_recordsnumber
Example output
{
  "current_page": 1,
  "records": [
    {
      "field_1": "Acme Ltd",
      "field_2": "Customer",
      "field_3": 42,
      "id": "575482d691e16d4235adcdb6"
    }
  ],
  "total_pages": 1,
  "total_records": 1
}

List records in a view

Return one page of records exactly as a table, list, search or calendar view shows them, with only the view's fields.

Inputs

Pagescene_keytextRequired
The page (scene) the view is on, such as scene_1.
Viewview_keytextRequired
A table, list, search or calendar view.
Records per pagerows_per_pagenumber
How many records to return, 1-1000.From 1 to 1000. Default: 25.
Page numberpagenumber
Which page of results to return, starting at 1.At least 1. Default: 1.
Sort by fieldsort_fieldtext
The field to sort by. Leave blank for Knack's default order.
Sort ordersort_ordertext
Ascending or descending, when a sort field is chosen.One of: asc (Ascending), desc (Descending). Default: asc.
Value formatformattext
Raw gives structured values (best for later steps), HTML the formatted text Knack displays, Both gives field_N as HTML and field_N_raw as raw.One of: raw, both, html. Default: raw.
Parent page slugparent_page_slugtext
For a view on a child page only: the page slug from its URL, such as company-details.
Parent record IDparent_record_idtext
For a child page only: the record the page is for.

Outputs

current_pagenumber
recordslist
total_pagesnumber
total_recordsnumber
Example output
{
  "current_page": 1,
  "records": [
    {
      "field_1": "Acme Ltd",
      "field_2": "Customer",
      "field_3": 42,
      "id": "575482d691e16d4235adcdb6"
    }
  ],
  "total_pages": 1,
  "total_records": 1
}

List views

List the app's pages and the views on them, with each view's type, object and whether its page needs a login.

Inputs

Pagescene_keytext
Only this page's views. Leave blank for all pages.

Outputs

totalnumber
viewslist
Example output
{
  "total": 1,
  "views": [
    {
      "object_key": "object_1",
      "parent_scene_slug": null,
      "requires_login": false,
      "scene_key": "scene_1",
      "scene_name": "Companies",
      "scene_slug": "companies",
      "view_key": "view_1",
      "view_name": "Companies table",
      "view_type": "table"
    }
  ]
}

Log in an app user

Check an app user's email and password and return their record id and user roles. Leave both blank to check the app user saved on the connection.

Inputs

Emailemailtext
The app user's email address.
Passwordpasswordtext
The app user's password.

Outputs

approval_statustext
emailtext
idtext
logged_intrue/false
profile_keyslist
profile_objectslist
valuesobject
Example output
{
  "approval_status": "approved",
  "email": "ada@example.com",
  "id": "5d65e8b2a1c3f40011223344",
  "logged_in": true,
  "profile_keys": [
    "profile_1"
  ],
  "profile_objects": [
    {
      "entry_id": "5d65e8b2a1c3f40011223344",
      "object": "object_2"
    }
  ],
  "values": {}
}

Search records

Find an object's records matching a field rule, optionally combined with more rules in Knack's filter format.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Filter fieldfield_keytext
The field to filter on.
Operatoroperatortext
How to compare. Blank checks, 'is any' and the 'today' / 'current time' operators need no value.One of: is, is not, contains, does not contain, starts with, ends with, is blank, is not blank, is any, higher than, and 15 more. Default: is.
Valuevaluetext
The value to compare with. To match a connected record, use the connection field with 'is' and the connected record's id. Dates use the field's own format, such as 09/24/2026.
Range amountrange_amountnumber
For 'is during the previous/next', 'is before the previous' and 'is after the next': how many units, such as 3.At least 1.
Range unitrange_unittext
For the 'is during ...' operators: the unit, such as days, weeks, months or years.
Advanced filters (JSON)filtersobject
Optional extra rules in Knack's filter format, such as {"match": "or", "rules": [{"field": "field_1", "operator": "contains", "value": "Ltd"}]}. Combined with the rule above.
Matchmatchtext
Whether records must match all rules or any rule.One of: and (All rules), or (Any rule). Default: and.
Records per pagerows_per_pagenumber
How many records to return, 1-1000.From 1 to 1000. Default: 25.
Page numberpagenumber
Which page of results to return, starting at 1.At least 1. Default: 1.
Sort by fieldsort_fieldtext
The field to sort by. Leave blank for Knack's default order.
Sort ordersort_ordertext
Ascending or descending, when a sort field is chosen.One of: asc (Ascending), desc (Descending). Default: asc.
Value formatformattext
Raw gives structured values (best for later steps), HTML the formatted text Knack displays, Both gives field_N as HTML and field_N_raw as raw.One of: raw, both, html. Default: raw.

Outputs

current_pagenumber
recordslist
total_pagesnumber
total_recordsnumber
Example output
{
  "current_page": 1,
  "records": [
    {
      "field_1": "Acme Ltd",
      "field_2": "Customer",
      "field_3": 42,
      "id": "575482d691e16d4235adcdb6"
    }
  ],
  "total_pages": 1,
  "total_records": 1
}

Submit a form

Create a record through a Form view, running the form's record rules (emails, connected updates). Only the form's own fields are saved.

Inputs

Pagescene_keytextRequired
The page (scene) the view is on, such as scene_1.
Viewview_keytextRequired
A Form view that adds records.
FieldsfieldsobjectRequired
The form's values. Fill in the fields to set and leave the rest blank. Name, Address, Email and Link values take JSON such as {"first": "Ada", "last": "Lovelace"}; a connection takes a list of record ids; a file or image field takes the id from 'Upload a file'; Yes/No takes true, false or kn-blank to clear it.

Outputs

recordobject
A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').
submit_keytext
Example output
{
  "record": {
    "field_1": "Acme Ltd",
    "field_2": "Customer",
    "field_3": 42,
    "id": "575482d691e16d4235adcdb6"
  },
  "submit_key": "submit_1"
}

Update a record

Change some of a record's fields. Blank fields are not touched.

Inputs

Objectobject_keytextRequired
The Knack object (table), such as object_1.
Record IDrecord_idtextRequired
The record to change. A Builder URL containing the id also works.
FieldsfieldsobjectRequired
The values to change. Fill in the fields to set and leave the rest blank. Name, Address, Email and Link values take JSON such as {"first": "Ada", "last": "Lovelace"}; a connection takes a list of record ids; a file or image field takes the id from 'Upload a file'; Yes/No takes true, false or kn-blank to clear it.

Outputs

A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').

idtext
The record id.
Example output
{
  "field_1": "Acme Ltd",
  "field_2": "Customer",
  "field_3": 42,
  "id": "575482d691e16d4235adcdb6"
}

Update a record through a view

Update a record through an edit form, or a table or search view with inline editing on. Fields not in the view are not changed.

Inputs

Pagescene_keytextRequired
The page (scene) the view is on, such as scene_1.
Viewview_keytextRequired
An edit form, or a table or search with inline editing on.
Record IDrecord_idtextRequired
The record to change. A Builder URL containing the id also works.
FieldsfieldsobjectRequired
The values to change. Fill in the fields to set and leave the rest blank. Name, Address, Email and Link values take JSON such as {"first": "Ada", "last": "Lovelace"}; a connection takes a list of record ids; a file or image field takes the id from 'Upload a file'; Yes/No takes true, false or kn-blank to clear it.

Outputs

recordobject
A Knack record. Besides id it carries one key per field, such as field_1 (and field_1_raw when the format is 'both').
submit_keytext
Example output
{
  "record": {
    "field_1": "Acme Ltd",
    "field_2": "Customer",
    "field_3": 42,
    "id": "575482d691e16d4235adcdb6"
  },
  "submit_key": "submit_1"
}

Upload a file

Upload a file or image to the app. Put the returned id in a file or image field with Create or Update a record. Knack needs a separate upload for each field it is attached to.

Inputs

Upload asasset_typetextRequired
File for a file field, Image for an image field.One of: file, image. Default: file.
Filefiletext
Upload a file or pick one from an earlier step. Leave blank to upload the text below as a file instead.
Text contenttext_contenttext
Text to upload as a file, such as a CSV built in an earlier step. Used only when no file is given.
File namefilenametext
The name Knack shows, such as report.csv. Defaults to the uploaded file's own name.

Outputs

filenametext
idtext
public_urltext
sizenumber
thumb_urltext
typetext
Example output
{
  "filename": "report.csv",
  "id": "5e2f1c9a8b7d6e5f4a3b2c1d",
  "public_url": "https://s3.amazonaws.com/assets/report.csv",
  "size": 1024,
  "thumb_url": "",
  "type": "file"
}

On this page