Form Component
The FormComponent renders a full Atlas Form inside the interaction UI. It is the most powerful interaction type — the payload specifies an Atlas Form ID, and the response is the complete set of submitted form field values.
How It Works
The FormComponent integrates directly with Atlas Forms via the FormRenderer from the player-components-react package. When the interaction is received:
Payload Contains formId
The payload carries the Atlas Form ID and any pre-fill data. The FormComponent passes these to FormRenderer.
FormRenderer Loads the Form
FormRenderer fetches the form schema from the Atlas Forms API by formId and renders the fully interactive form with all fields, validation, and layout.
User Submits — Response Contains Field Data
On form submission, FormComponent calls respond("submitted", formData) where formData is an object mapping field keys to values.
Form Payload Schema
interface FormPayload {
/** Atlas Form ID — the form schema to render */
formId: number;
/** Pre-fill values — mapped to form field keys */
initialValues?: Record<string, unknown>;
/** Submit button label (default: "Submit") */
submitLabel?: string;
/** Cancel button label (default: "Cancel") */
cancelLabel?: string;
}
Response Schema
// Outcome: "submitted"
// Data: all submitted form field values
interface FormResponseData {
[fieldKey: string]: unknown;
}
// Example response data
{
"recipientName": "Jane Smith",
"country": "US",
"address": "123 Main St",
"city": "Springfield",
"postalCode": "62701"
}
Server-Side Usage
// Server — send a form interaction
var request = new InteractionRequest {
Type = InteractionTypes.Form,
TargetUserId = userId,
Title = "Enter Shipping Details",
Description = "Please provide the shipping address for this order.",
Payload = new FormPayload {
FormId = 13042, // Atlas Form ID for "Shipping Address Form"
InitialValues = new Dictionary<string, object> {
{ "recipientName", currentUser.FullName },
{ "country", "US" }
},
SubmitLabel = "Save Shipping Details"
},
TimeoutMs = 600_000 // 10 minutes
};
var response = await _publisher.PublishAndWaitAsync(request, ct);
if (response.Outcome == "submitted")
{
var shippingData = response.Data?.Deserialize<Dictionary<string, object>>();
await _orderService.SetShippingAddressAsync(orderId, shippingData, ct);
}
Form Validation
Atlas Form validation rules (required fields, format validation, conditional fields) are enforced by the FormRenderer on the client side. The form cannot be submitted until all validation rules pass. The FormComponent does not send the response until the form submission event fires from FormRenderer.
formId must reference an active Atlas Form in the current tenant. If the form does not exist or is archived, FormRenderer will fail to load and the interaction will show an error state to the user.
Form Interaction vs. Atlas Form Player
| Feature | Form Interaction (EdgeInteract) | Atlas Form Player (standalone) |
|---|---|---|
| Triggered by | Server-side workflow or agent | User navigating to a form URL |
| Response destination | EdgeInteract callback topic | Form submission handler / API |
| Timeout | Yes — interaction timeout | No |
| Awaitable on server | Yes | No (async via webhook) |
| Audit trail | EdgeInteract audit hook | Atlas Forms submission log |