Function coerceSubmission

  • Coerce a whole submission against a field-type map. Unknown keys pass through untouched; mapped keys are coerced (and dropped if unparseable). Pair it with the field names/types from your FlowDraft.

    Parameters

    Returns Record<string, unknown>

    const data = coerceSubmission(submission, {
    budget: "number",
    preferred_date: "date",
    interests: "stringArray",
    });