Ana içeriğe geç

getFormsDataByMarker

Searching for form data by text identifier (marker).

Description

This method retrieves a specific form data object by its marker from the API. It accepts a marker parameter as the marker of the form data. It returns a Promise that resolves to an array of objects of type FormDataEntity.

FormData.getFormsDataByMarker(

marker*, formModuleConfigId*, body, isExtended, langCode, offset, limit

);

Parameters schema

Schema

marker(required): string
Marker of the form
example: "contact_form"

formModuleConfigId(required): number
Form module configuration ID
example: 4

body: IFormsDataFilter
Filter for the records to return. Every field is optional; an omitted or empty one is not applied
example:

{
"entityIdentifier": "blog",
"parentId": 10,
"userIdentifier": "",
"status": [
"moderation",
"approved"
],
"dateFrom": "2025-01-01",
"dateTo": ""
}

body.entityIdentifier: string
Text identifier (marker) of the entity the records belong to; an empty string means "no filter".
example: "blog"

body.parentId: number
Identifier of the parent record — the way to fetch replies to one comment.
example: 10

body.userIdentifier: string
Text identifier of the sender; an empty string means "no filter".
example: "admin"

body.status: FormDataStatus[]
Moderation statuses to keep. Must be an array — a bare string is rejected with 400. An empty array means "no filter".
example: ["approved"]

body.dateFrom: string
Lower bound of the submission date, YYYY-MM-DD; an empty string means "no bound". A value the API cannot parse fails the request with a 500.
example: "2025-01-01"

body.dateTo: string
Upper bound of the submission date, YYYY-MM-DD; an empty string means "no bound".
example: "2025-12-31"

isExtended: number
Flag for getting additional fields
example: 1

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 FormData.getFormsDataByMarker('my-marker', 2);

Example with a filter

const response = await FormData.getFormsDataByMarker(
'my-marker',
2,
{ entityIdentifier: 'blog', status: ['approved'] },
0,
'en_US',
0,
30,
);
formData comes back without the locale wrapper

The API returns each record's fields wrapped by language — "formData": { "en_US": [ … ] } — and the SDK unwraps them for the requested langCode. Read record.formData as an array; record.formData[langCode] is undefined and quietly yields nothing. This holds for both values of isExtended.

Example response

{
"items": [
{
"id": 8409,
"formIdentifier": "test-form",
"time": "2026-08-23T17:47:58.472Z",
"formData": [
{
"marker": "name",
"type": "string",
"value": "Test"
}
],
"attributeSetIdentifier": "form",
"moduleIdentifier": "content"
},
{
"id": 8392,
"formIdentifier": "test-form",
"time": "2026-08-23T14:37:47.250Z",
"formData": [
{
"marker": "name",
"type": "string",
"value": "Test"
}
],
"attributeSetIdentifier": "form",
"moduleIdentifier": "content"
},
{
"id": 8375,
"formIdentifier": "test-form",
"time": "2026-08-23T14:31:26.065Z",
"formData": [
{
"marker": "name",
"type": "string",
"value": "Test"
}
],
"attributeSetIdentifier": "form",
"moduleIdentifier": "content"
},
"..."
],
"total": 853
}

Response schema

Schema: IFormsDataEntity

items: IFormByMarkerDataEntity[]
Array of form data objects.
example:

[
{
"id": 42,
"parentId": null,
"formIdentifier": "test-form",
"depth": 0,
"ip": null,
"status": null,
"userIdentifier": null,
"formData": [
{
"marker": "name",
"type": "string",
"value": "Test"
}
],
"attributeSetIdentifier": "form",
"time": "2025-03-03T15:51:17.458Z",
"entityIdentifier": "blog",
"isUserAdmin": false,
"formModuleConfigId": 2
}
]

items.id: number
The unique identifier of the form page.
example: 12345

items.parentId: null | number
The unique identifier of the parent form page.
example: 123

items.formIdentifier: string
The identifier of the page.
example: "contact_form"

items.depth: number
**
example: 1

items.ip: string | null
Ip.
example: '127.0.0.1'

items.fingerprint: string | null
Fingerprint.
example: 'fingerprint'

items.status: string | null
Moderation status of the record: "sent", "moderation", "approved", "banned" or "deleted"; null when the form does not moderate.
example: 'approved'

items.userIdentifier: string | null
Text identifier (marker) of the user.
example: "admin"

items.formData: FormDataType[]
Submitted fields, already unwrapped from the locale: the API returns { "en_US": [ … ] } and the SDK hands over the array for the requested langCode. Read formData directly — formData[langCode] is undefined.
example:

[
{
"marker": "name",
"type": "string",
"value": "Test"
}
]

items.attributeSetIdentifier: string | null
Text identifier (marker) of the used attribute set.
example: "product_attributes"

items.time: Date | string
The identifier of the form.
example: "2023-10-01T12:00:00Z"

items.entityIdentifier: string
Text identifier (marker) of the entity.
example: "test"

items.isUserAdmin: boolean
Is user admin.
example: true

items.formModuleConfigId: number
Form module config Id.
example: 2

items.moduleIdentifier: string
Module identifier.
example: "blog"

items.entityId: number
Form module config Id.
example: 2

total: number
Total number of found records.
example: 100