getAllForms
Get all form objects.
Description
This method retrieves all form objects with pagination. It returns a Promise that resolves to an IFormsResponse object containing items and total count.
Forms.getAllForms(
langCode,
offset,
limit
);
Parameters schema
Schema
langCode: string
Language code. Default: "en_US"
example: "en_US"
offset: number
Parameter for pagination. Default: 0
example: 0
limit: number
Parameter for pagination. Default: 30
example: 30
By default, you can retrieve 10 objects. This is due to the record limit in the module's permissions settings.
For pagination to work correctly, you need to configure Module permissions according to your needs in the corresponding section.
Examples
Minimal example
const response = await Forms.getAllForms();
Example with attributes
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": 9,
"position": 1,
"identifier": "user_form",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "name_attr",
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"initialValue": null,
"localizeInfos": {
"title": "name"
},
"additionalFields": {}
},
{
"type": "string",
"marker": "username",
"position": 2,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"initialValue": null,
"localizeInfos": {
"title": "username"
},
"additionalFields": {}
},
{
"type": "string",
"marker": "password",
"position": 3,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"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": 14,
"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
}
},
"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": {},
"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": 15,
"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
}
},
"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": {},
"initialValue": null,
"localizeInfos": {
"title": "File"
},
"additionalFields": {}
}
]
},
"..."
],
"total": 9
}
Response schema
Schema: IFormsEntity[]
total: number
Total items count.
items: IFormsEntity[]
Array of form entities.
items.id: number
The identifier of the object.
example: 12345
items.attributeSetId: number | null
The identifier of the attribute set being used, or null if not applicable.
example: 1234
items.type: string | null
Form type.
example: "contact"
items.localizeInfos: IFormLocalizeInfo
The name of the form and form-side localization fields (success/error messages, processing config, etc.).
example:
{
"key": "value"
}
items.version: number
The version number of the object.
example: 1
items.position: number
The position of the object.
example: 1
items.identifier: string
The textual identifier for the record field.
example: "form_contact_us"
items.processingType: string
Type of form processing.
example: "async"
items.templateId: number | null
The identifier of the template used by the form, or null if no template is used.
example: 6789
items.attributes: IFormAttribute[]
Form fields with their localization, validators and form-specific flags.
items.total: number | string
Total count of related entries.
example: "1"
items.moduleFormConfigs: IFormConfig[]
Array of module form configurations associated with the form.
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 first visit, then open:
- Get all forms — retrieve every form configured in the project.