Skip to content

Event Notifications Troubleshooting

This article covers common issues when receiving postMessage host events from ProcessFactorial Forms in a parent application.


Events never arrive in the parent listener

Error message (sample)

No error is shown — the parent application simply does not receive events.

Symptoms

  • The parent window's message event listener is never called when the user interacts with the form.
  • Host UI elements that depend on form navigation or field changes remain unresponsive.

Root cause

One of the following:

  1. The parent window has not registered a message event listener.
  2. The listener is on the wrong window — if the form is in an iframe, the listener must be on the parent window, not the iframe.
  3. The listener is filtering out events by event.origin or event.data.type.
  4. The form snippet is not configured to send host notifications.

Resolution

  • Register window.addEventListener('message', handler) in the parent window.
  • If using an iframe, ensure the listener is on the parent window, not the iframe's content window.
  • Check your origin filter — allow the form's host origin (e.g. https://forms.processfactorial.com).
  • Verify the event type in your listener accepts 'processfactorial:host-event' and 'pfEventTriggerNotification'.
  • Confirm the form designer has enabled host notifications for the relevant controls or events.

Events contain unexpected or missing data

Error message (sample)

No error — the event payload does not contain expected fields.

Symptoms

  • The normalized event object has null values for pageId, fieldId, or other expected fields.
  • Custom data from ForwardToHost pipeline events is missing.

Root cause

The payload format depends on the event type and trigger. Legacy events use the pfEventTriggerNotification format, while newer events use the processfactorial:host-event format. Additionally, ForwardToHost events include a data object with field values, but other event types do not.

Resolution

  • Use the normalizeHostMessage function (provided in the Event Notifications guide) to handle both payload formats uniformly.
  • Check normalized.channel to determine which format the event arrived in.
  • Only expect data (field values) when the event was emitted by a ForwardToHost pipeline event.
  • Verify the form designer has configured the correct field selections on the ForwardToHost event.

Events arrive only sometimes

Error message (sample)

No error — some events are received but others are not.

Symptoms

  • Navigation events are received, but field change events are not (or vice versa).
  • Custom button events are missing.
  • Events are received for some form interactions but not others.

Root cause

Host notifications are configured per control or event in the form designer. Not all interactions emit host events by default.

Resolution

  • In the form designer, check that host notification is enabled for the specific controls or events you need.
  • For field changes, ensure the field's Host Notification setting is enabled.
  • For custom buttons, check the data-host-notify-phase attribute (before, after, or both).
  • For ForwardToHost pipeline events, confirm the event is configured in the form's event pipeline.

Notes and references