getFormByMarker
Getting one form object by marker.
Description
This method retrieves a single form object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a FormEntity object.
Forms.getFormByMarker(
marker,
langCode
);
Parameters schema
Schema
marker(required): string
Marker of form
example: "contact_form"
langCode: string
Language code. Default: "en_US"
example: "en_US"
Examples
Minimal example
const value = await Forms.getFormByMarker('my-form');
Example with attributes
const value = await Forms.getFormByMarker('my-form', 'en_US');
Example response
{
"id": 6,
"attributeSetId": 15,
"type": "data",
"localizeInfos": {
"title": "Test form",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 4,
"position": 1,
"identifier": "test-form",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "name",
"isLogin": null,
"isSignUp": null,
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"localizeInfos": {
"title": "Name"
},
"additionalFields": [],
"isNotificationEmail": null,
"isNotificationPhoneSMS": null,
"isNotificationPhonePush": null
},
{
"type": "file",
"marker": "file",
"isLogin": null,
"isSignUp": null,
"position": 2,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"localizeInfos": {
"title": "File"
},
"additionalFields": [],
"isNotificationEmail": null,
"isNotificationPhoneSMS": null,
"isNotificationPhonePush": null
}
]
}
Response schema
Schema: IFormsEntity
id: number
The identifier of the object.
example: 12345
attributeSetId: number | null
The identifier of the attribute set being used, or null if not applicable.
example: 1234
type: string | null
Form type.
example: "contact"
localizeInfos: ILocalizeInfo
The name of the form, taking into account localization.
example:
{
"key": "value"
}
version: number
The version number of the object.
example: 1
position: number
The position of the object.
example: 1
identifier: string
The textual identifier for the record field.
example: "form_contact_us"
processingType: string
Type of form processing.
example: "async"
templateId: number | null
The identifier of the template used by the form, or null if no template is used.
example: 6789
attributes: IAttributes[] | Record<string, any>
The attributes of the form, which can be an array of attribute objects or a record of key-value pairs.
example:
{
"key": "value"
}