Nhảy đến nội dung

getFormsDataByMarker

Tìm kiếm dữ liệu biểu mẫu theo định danh văn bản (marker).

Mô tả

Phương thức này lấy một đối tượng dữ liệu biểu mẫu cụ thể theo marker của nó từ API. Nó chấp nhận tham số marker như là marker của dữ liệu biểu mẫu. Nó trả về một Promise mà khi hoàn thành sẽ trả về một mảng các đối tượng thuộc loại FormDataEntity.

FormData.getFormsDataByMarker(

marker, formModuleConfigId, body, isNested, langCode, offset, limit

);

Sơ đồ tham số

Sơ đồ

marker(bắt buộc): string
Marker của biểu mẫu
ví dụ: "contact_form"

formModuleConfigId(bắt buộc): number
ID cấu hình mô-đun biểu mẫu
ví dụ: 4

body: object
Nội dung yêu cầu
ví dụ:

{
"entityIdentifier": "test",
"userIdentifier": "",
"status": "",
"dateFrom": "2025-08-11",
"dateTo": ""
}

isNested: any
Cờ để lấy dữ liệu phân cấp
ví dụ: 1

langCode: string
Mã ngôn ngữ. Mặc định: "en_US"
ví dụ: "en_US"

offset: number
Tham số cho phân trang. Mặc định: 0
ví dụ: 0

limit: number
Tham số cho phân trang. Mặc định: 30
ví dụ: 30

Ví dụ

Ví dụ tối thiểu

const response = await FormData.getFormsDataByMarker('my-marker');

Ví dụ với các thuộc tính

const response = await FormData.getFormsDataByMarker('my-marker', 'en_US', 0, 30);

Ví dụ phản hồi

{
"items": [
{
"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
},
{
"id": 43,
"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:43.596Z",
"entityIdentifier": "blog",
"isUserAdmin": false,
"formModuleConfigId": 2
},
{
"id": 44,
"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:52:00.625Z",
"entityIdentifier": "blog",
"isUserAdmin": false,
"formModuleConfigId": 2
},
"..."
],
"total": 213
}

Sơ đồ phản hồi

Sơ đồ: IFormsDataEntity

items: IFormByMarkerDataEntity[]
Mảng các đối tượng dữ liệu biểu mẫu.
ví dụ:

  [
{
"id": 43,
"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:43.596Z",
"entityIdentifier": "blog",
"isUserAdmin": false,
"formModuleConfigId": 2
}
]

total: number
Tổng số bản ghi được tìm thấy.
ví dụ: 100