Form Schemas: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation.

Create a custom lead-capture form

In this scenario, you're building an app that provides a specialized lead-capture form to integrate with an external CRM or a proprietary data system. This is useful for offering advanced customer management or marketing automation services.

To create a custom lead-capture form:

  1. Call Create Form to build a new form schema on the user's Wix site. In your call, you can define all the necessary fields, such as 'Name', 'Email', 'Phone Number', and 'Inquiry'.
  2. Store the formId that's returned in the response. You'll need to use this ID if you want to manage the form schema in the future.
  3. Your app can now listen for form submission events using the Form Submissions API. For example, when a site visitor submits the form, your app can receive the data through the Submission Created event, which you can then process and send to your external CRM or database.

Update an existing form with new fields

In this scenario, you're building an app that allows users to modify existing form schemas. For example, adding a "How did you hear about us?" dropdown to a contact form schema to gather more detailed marketing insights. Your app can provide the interface to make this change.

To add a new field to an existing form schema:

  1. Call List Forms to retrieve a list of all form schemas and present them to the user for selection.
  2. Store the formId of the selected form schema.
  3. Call Get Form to retrieve the complete, current structure of that form schema.
  4. In your app's UI, use the data from Get Form to display the form schema's current fields and allow the user to add, edit, or remove fields.
  5. After the user saves their changes, call Update Form, passing the new, updated form schema structure in the request body. The form schema on the site will be instantly updated.

Sync form data with an external application

In this scenario, you're building an app that act as a bridge between Wix Forms and another system, such as a project management tool, a spreadsheet, or a custom database.

To sync form data:

  1. First, create a new form schema using Create Form or let the user select an existing form schema using by calling List Forms and presenting them the options to choose from. Then save the ID.
  2. Using the ID from the selected or created form schema, implement an event listener in your app to receive notifications for events such as Form Created, and Form Updated. When these events occur, use the information in the payload to update the form schema data in your external system.
  3. Implement an event listener in your app to receive notifications for Form Submission events. When these events occur, check the formId in the payload to see if the event matches the ID of the form schema you created or selected in step 1. If it matches, use the information in the payload to create, delete, or update the form submission record in your external system.
Did this help?