Skip to main content

getFormByMarker

Get a single form by its marker.

Description​

Fetches a form by its marker and resolves to an IFormsEntity: the form's fields, validators and localized labels.

.getFormByMarker(

,

);

Parameters schema​

Schema

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

langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"

Examples​

Minimal example​

const response = await Forms.getFormByMarker('test-form');

Example with langCode​

const response = await Forms.getFormByMarker('test-form', 'en_US');

Example response​

{
"id": 6,
"attributeSetId": 15,
"type": "data",
"localizeInfos": {
"title": "Test form",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 15,
"position": 1,
"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
}
},
"multiselect": false,
"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": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "File"
},
"additionalFields": {}
}
],
"total": "1",
"moduleFormConfigs": [
{
"id": 2,
"formId": 6,
"moduleId": 4,
"moduleIdentifier": "content",
"isGlobal": false,
"isModerate": false,
"isClosed": false,
"viewOnlyUserData": false,
"commentOnlyUserData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"ratingCalculation": "average",
"allowHalfRatings": null,
"showAggregatedRating": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null
}
]
}

Response schema​

Schema: IFormsEntity

id: number
ID of the form.
example: 12345

attributeSetId: number | null
ID of the attribute set the form uses, or null if there is none.
example: 1234

type: string | null
Form type.
example: "contact"

localizeInfos: IFormLocalizeInfo
Localized name of the form and form-side texts such as success and error messages.
example:

{
"title": "Example title"
}

localizeInfos.title: string
Localized name of the form. Optional — the payload is an empty object when the form has no localization for the requested language (e.g. in list responses).
example: "Contact form"

localizeInfos.titleForSite: string
Public-facing title shown on the website.
example: "Form title (for application)"

localizeInfos.successMessage: string
Message shown to the user after successful submission.

localizeInfos.unsuccessMessage: string
Message shown to the user after a failed submission.

localizeInfos.urlAddress: string
URL where the form data is sent for processing (used by processingType: "url").

localizeInfos.database: string
Database flag or ID used by the form processor. The API sends it as a string: "0", "1" or an ID.

localizeInfos.script: string
Script flag or ID used by the form processor. The API sends it as a string: "0", "1" or an ID.

version: number
Version number of the object; changes with each update.
example: 1

position: number
1-based position of the form in the full list ordered by ID; with offset, numbering continues from offset + 1. Always 1 from getFormByMarker().
example: 1

identifier: string
Marker of the form.
example: "form_contact_us"

processingType: string
How form submissions are processed: the processing type chosen in the form settings.
example: "script"

templateId: number | null
ID of the template used by the form, or null when the form has no template.
example: 6789

attributes: IFormAttribute[]
Form fields with their localization, validators and form-specific flags, sorted by position. The API returns an empty object for forms with no attributes — the SDK normalizes it to an empty array.

attributes.marker: string
Marker of the field.
example: "email"

attributes.type: AttributeType
Attribute data type (e.g. "string", "file").

attributes.position: number
Sort position of the field.
example: 1

attributes.isVisible: boolean
Whether the field is exposed to the user.
example: true

attributes.localizeInfos: IAttributeLocalizeInfo
Localized labels for the field. For timeInterval attributes, also carries the intervals schedule payload.

attributes.initialValue: unknown
Default value applied when the field is not filled.

attributes.listTitles: IListTitle[]
Predefined options for list/radioButton fields; empty array for other types.

attributes.multiselect: boolean
For list fields — whether several options from listTitles may be selected. Optional.
example: false

attributes.validators: IAttributeValidators
Validation rules; empty object when no validators are configured.

attributes.settings: Record<string, unknown>
Field-specific configuration; empty object by default.

attributes.additionalFields: Record<string, IFormAttributeAdditionalField>
Nested sub-fields keyed by marker; an empty object when there are none.

attributes.isLogin: boolean
Whether this field holds the login used for authentication. Present only on attributes of sign-in and sign-up forms.
example: false

attributes.isSignUp: boolean
Whether this field is used during sign-up. Present only on attributes of sign-in and sign-up forms.
example: false

attributes.isPassword: boolean
Whether this field holds the password used for authentication. Present only on attributes of sign-in and sign-up forms.
example: false

attributes.isSignUpRequired: boolean
Whether this field is required during sign-up. Present only on attributes of sign-in and sign-up forms.
example: false

attributes.isNotificationEmail: boolean
Whether this field holds the email used for notifications. Present only on attributes of sign-in and sign-up forms.
example: false

attributes.isNotificationPhonePush: boolean
Whether this field holds the phone number used for push notifications. Present only on attributes of sign-in and sign-up forms.
example: false

attributes.isNotificationPhoneSMS: boolean
Whether this field holds the phone number used for SMS notifications. Present only on attributes of sign-in and sign-up forms.
example: false

moduleFormConfigs: IFormConfig[]
Module bindings of the form. Returned by getFormByMarker() only; getAllForms() omits it.

moduleFormConfigs.id: number
ID of the form configuration.
example: 123

moduleFormConfigs.formId: number
Numeric ID of the form the configuration belongs to. Returned by the Forms API (getFormByMarker).
example: 6

moduleFormConfigs.moduleId: number
Numeric ID of the module the configuration belongs to. Returned by the Forms API (getFormByMarker).
example: 4

moduleFormConfigs.formIdentifier: string
Marker of the form (products and pages API only).
example: "review"

moduleFormConfigs.moduleIdentifier: string
Marker of the module the form configuration belongs to.
example: "module_identifier"

moduleFormConfigs.isGlobal: boolean
Whether the form configuration is global.
example: true

moduleFormConfigs.isClosed: boolean
Whether the form configuration is closed.
example: true

moduleFormConfigs.isModerate: boolean
Whether the form requires moderation. Returned only by the Products and Pages APIs.
example: false

moduleFormConfigs.viewOnlyUserData: boolean
Whether users see only the form data they submitted themselves.
example: true

moduleFormConfigs.commentOnlyUserData: boolean
Whether commenting is limited to user data (forms API).
example: true

moduleFormConfigs.viewOnlyMyData: boolean
Whether users can view only their own form data. Returned only by the Products and Pages APIs.
example: false

moduleFormConfigs.commentOnlyMyData: boolean
Whether commenting is limited to the user's own data (products and pages API).
example: false

moduleFormConfigs.entityIdentifiers: object[]
Entities the form configuration is attached to.

moduleFormConfigs.nestedEntityIdentifiers: string[]
Markers of nested entities. Returned only by the Products and Pages APIs.
example: ["catalog"]

moduleFormConfigs.exceptionIds: string[]
Exception IDs.

moduleFormConfigs.formDataCount: number
Total number of form records (products and pages API only).
example: 306

moduleFormConfigs.entityFormDataCount: Record<string, number>
Number of form records per entity ID (products and pages API only).
example:

{"catalog": 306}

moduleFormConfigs.isRating: boolean | null
Whether this form configuration collects ratings.
example: null

moduleFormConfigs.isAnonymous: boolean | null
Whether anonymous submissions are allowed.
example: null

moduleFormConfigs.allowHalfRatings: boolean | null
Whether half-star ratings are allowed.
example: null

moduleFormConfigs.allowRerating: boolean | null
Whether a user can rate the same entity again.
example: null

moduleFormConfigs.maxRatingScale: number | null
Maximum rating scale value.
example: 5

moduleFormConfigs.ratingCalculation: string
Rating calculation method.
example: "average"

moduleFormConfigs.showAggregatedRating: boolean | null
Whether the aggregated rating is shown for the entity.
example: null


Usage examples​

Step-by-step walkthroughs in the documentation:

  • Submit a form — fetch a contact form by marker and post user input back to OneEntry.
  • Entity form — handle a form that contains an entity-type field (pages or products).
  • Register user — use a sign-up form to create a new account.

Try it live​

Run this method interactively in the JS SDK sandbox. Connect your Project URL and App Token on your first visit, then open any scenario below to see Forms.getFormByMarker() in action:

  • Submit a form — fetch a contact form by marker and post user input back to OneEntry.
  • Entity form — handle a form that contains an entity-type field (pages or products).
  • File form — submit a form that includes a file attachment.
  • Spam form — submit a form with spam protection.
  • Schedule form — pick a time slot from a timeInterval field and submit it.
  • Formik form — build a Formik form from a OneEntry form config using useFormConfig.
  • Register user — use a sign-up form to create a new account.