--- title: "Subscribe to message (Form)" slug: "fre-subscribe-to-message-vo" updated: 2026-05-12T07:00:04Z published: 2026-05-12T07:00:04Z canonical: "docs.lobstersoftware.com/fre-subscribe-to-message-vo" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Subscribe to message (Form) "Subscribe to message" is a **form service element** that registers for push messages on a specific topic. The **Topic** property acts as a filter. Only push messages sent to the matching topic are received. When a matching message arrives, the **"Receive message"** event fires on the element. If the element is deactivated, no events fire. > [!TIP] > Tip > > A push message is sent from the server side via the [Push message](/v1/docs/en/core-push-message-actor-configuration) event action. Topics are freely selectable. **NOTE:** Only clients with an active subscription to the topic receive push messages. ## Properties | Property | Description | | --- | --- | | **Topic** | A static text value or value configuration that identifies the channel to subscribe to. The value must match the **Topic** set in the corresponding [Push message](/v1/docs/en/core-push-message-actor-configuration) event action **exactly** (case-sensitive). | ## The "Receive message" event When a push message arrives on the subscribed topic, the **"Receive message"** event fires. Configure a **Behavior** on the element in the form designer to react to this event. The **Payload** sent by the [Push message](/v1/docs/en/core-push-message-actor-configuration) event action becomes the **input value** of the triggered behavior. Inside the behavior"s event actions, the input value is available under the variable name `$input`. ## Accessing the payload in a Behavior How you access `$input` depends on the payload type: | Payload type | What `$input` contains | How to read it | | --- | --- | --- | | No value | `$null` — the sender transmitted no data. | Use a **Static rule** to check that `$input` is not null before processing. | | Simple value (string, number, boolean) | The scalar value itself, e.g. an order ID or a status code. | Use a **Variable value resolver** and enter `$input` as the variable name. The resolver returns the value directly. | | Complex object (entity or data structure) | An object with named properties, e.g., `{id, status, name}`. | Use a **Variable value resolver** with `$input` to get the whole object. Chain an **Object property resolver** to read a specific property, e.g., `id` or `status`. | | List (`String[]`, entity list, etc.) | A list of values or objects. | Use a **Variable value resolver** with `$input` to get the whole list. Iterate with a **For each** event action to process individual entries. | > [!WARNING] > **IMPORTANT:** > > The payload type depends entirely on what the sender configured in the [Push message](/v1/docs/en/core-push-message-actor-configuration) event action. Coordinate with whoever configures the sender to know the expected payload structure before building the Behavior. ## Example: Refresh a list when data changes A server-side event handler sends a push message with topic `order.updated` whenever an order is saved. The payload is the updated order object. A portal form contains a "Subscribe to message" element. **Goal:** Read the order ID from the payload and store it in a variable, then reload the list. 1. Set the element's **Topic** to `order.updated`. 2. Add a **Behavior** with **"Receive message"** as the trigger. 3. Add a **Set variable** event action. In the value configuration, chain: Store the result in a variable, e.g. `lastUpdatedOrderId`. - **Variable value resolver** → variable name: `$input` (returns the full order object) - **Object property resolver** → property: `id` (reads the order ID from the object) 4. Add a **Reload** event action after the Set variable action to refresh the list. **Result:** every open session with the form reads the incoming order ID and reloads automatically—without the user refreshing the page.