Skip to main content

getFormsByPageUrl

Receiving objects for a related form by URL

Pages.getFormsByPageUrl(url, langCode)

const value = await Pages.getFormsByPageUrl('shop')
Schema

url:* string
Page URL
example: shop

langCode: string
lang code
example: en_US

Get PositionForm objects for a related form by url. Returns an array of PositionForm objects.

Example return:

[
{
"id": 1764,
"version": 10,
"identifier": "catalog",
"attributeSetId": 0,
"processingType": "email",
"localizeInfos": {
"title": "My form",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"processingData": {},
"position": 0,
"attributes": [
{
"type": "list",
"marker": "list_marker",
"position": 2,
"listTitles": [
{
"title": "red",
"value": 1,
"position": 1,
"extendedValue": null,
"extendedValueType": null
},
{
"title": "yellow",
"value": 2,
"position": 2,
"extendedValue": null,
"extendedValueType": null
}
],
"validators": {},
"localizeInfos": {
"title": "l1"
}
}
]
}
]
Schema

id: number
object identifier
example: 1764

version number
object version number
example: 10

identifier: string
text identifier for the record field
example: catalog

attributeSetId: number
attribute set identifier
example: 7

processingType: string
form processing type
example: email
Enum: [ db, email, script ]

localizeInfos: Record<string, any>
json description of the main page data object taking into account the language "en_US" (for example)
example:

{
"en_US": {
"title": "Catalog",
"plainContent": "Content for catalog",
"htmlContent": "<b>Content for catalog</b>",
"menuTitle": "Catalog"
}
}

processingData:
form data

attributes: Record<string, string>
array of attribute values from the used attribute set for displaying the form (taking into account the specified language)
example:

[
{
"type": "list",
"marker": "l1",
"position": 2,
"listTitles": [
{
"title": "red",
"value": 1,
"position": 1,
"extendedValue": null,
"extendedValueType": null
},
{
"title": "yellow",
"value": 2,
"position": 2,
"extendedValue": null,
"extendedValueType": null
}
],
"validators": {},
"localizeInfos": {
"title": "l1"
}
}
]

position: number
position number for sorting (optional)
example: 192