Skip to main content

getAllForms

Get all forms.

Description​

Fetches forms with pagination. Resolves to an IFormsResponse: the forms are in items, the count in total.

.getAllForms(

, ,

);

Parameters schema​

Schema

langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"

offset: number
Number of records to skip. Default: 0. offset + limit must not exceed 200; a larger window is rejected with 400.
example: 0

limit: number
Maximum number of records to return. Default: 30.
example: 30

Record limit. If the user group's permission for this method allows only restricted reading, the API returns at most the number of records set in the project settings (10 by default), whatever limit you pass. With full read access, limit works as usual. See Module permissions (opens in a new tab).

Examples​

Minimal example​

const response = await Forms.getAllForms();

Example with optional parameters​

const response = await Forms.getAllForms('en_US', 0, 30);

Example response​

{
"items": [
{
"id": 4,
"attributeSetId": 11,
"type": "data",
"localizeInfos": {
"title": "user_form",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 10,
"position": 1,
"identifier": "user_form",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "name_attr",
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "name"
},
"additionalFields": {}
},
{
"type": "string",
"marker": "username",
"position": 2,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "username"
},
"additionalFields": {}
},
{
"type": "string",
"marker": "password",
"position": 3,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "password"
},
"additionalFields": {}
}
]
},
{
"id": 6,
"attributeSetId": 15,
"type": "data",
"localizeInfos": {
"title": "Test form",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 15,
"position": 2,
"identifier": "test-form",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "name",
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {
"requiredValidator": {
"strict": true
},
"stringInspectionValidator": {
"stringMax": 0,
"stringMin": 0,
"stringLength": 0
}
},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "Name"
},
"additionalFields": {
"additional_field": {
"type": "string",
"value": "Additional field data"
}
}
},
{
"type": "file",
"marker": "file",
"position": 2,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "File"
},
"additionalFields": {}
}
]
},
{
"id": 7,
"attributeSetId": 15,
"type": "data",
"localizeInfos": {
"title": "File form",
"titleForSite": "Form title (for application)",
"successMessage": "Message about successful data processing",
"unsuccessMessage": "Message about unsuccessful data processing",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 16,
"position": 3,
"identifier": "file_form",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "name",
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {
"requiredValidator": {
"strict": true
},
"stringInspectionValidator": {
"stringMax": 0,
"stringMin": 0,
"stringLength": 0
}
},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "Name"
},
"additionalFields": {
"additional_field": {
"type": "string",
"value": "Additional field data"
}
}
},
{
"type": "file",
"marker": "file",
"position": 2,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "File"
},
"additionalFields": {}
}
]
}
],
"total": 9
}

Response schema​

Schema: IFormsResponse

total: number
Total number of forms.

items: IFormsEntity[]
Forms in this response.

items.id: number
ID of the form.
example: 12345

items.attributeSetId: number | null
ID of the attribute set the form uses, or null if there is none.
example: 1234

items.type: string | null
Form type.
example: "contact"

items.localizeInfos: IFormLocalizeInfo
Localized name of the form and form-side texts such as success and error messages.
example:

{
"title": "Example title"
}

items.version: number
Version number of the object; changes with each update.
example: 1

items.position: number
1-based position of the form in the full list ordered by ID; with offset, numbering continues from offset + 1. Always 1 from getFormByMarker().
example: 1

items.identifier: string
Marker of the form.
example: "form_contact_us"

items.processingType: string
How form submissions are processed, for example "email" or "url".
example: "async"

items.templateId: number | null
ID of the template used by the form, or null when the form has no template.
example: 6789

items.attributes: IFormAttribute[]
Form fields with their localization, validators and form-specific flags, sorted by position. The API returns an empty object for forms with no attributes — the SDK normalizes it to an empty array.

items.total: number | string
Internal row count that getFormByMarker() returns by mistake (always "1"); don't rely on it. Not returned by getAllForms() items; use the top-level total instead.
example: "1"

items.moduleFormConfigs: IFormConfig[]
Module bindings of the form. Returned by getFormByMarker() only; getAllForms() omits it.


Usage examples​

Step-by-step walkthrough in the documentation:

  • Get all forms — retrieve every form configured in the project.

Try it live​

Run this method interactively in the JS SDK sandbox. Connect your Project URL and App Token on your first visit, then open:

  • Get all forms — retrieve every form configured in the project.