Docs
Wized
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Getting Started with StudioForm and Wized

Getting started with StudioForm and Wized is easy! Just follow these steps to set up and start creating dynamic, interactive forms quickly and effortlessly.

Step
1

Create a Project in Wized

Start by creating a new project in Wized. This is where you'll manage everything related to your form.

Create a Project in Wized
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
2

Add the StudioForm Script

Make sure you've added the StudioForm script to the page where your form is. This script is important for making everything work smoothly.

Add the StudioForm Script
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
3

Add Wized Attribute to Form Element

Find the form element inside your form block and add the Wized attribute to it. Set the name to "Wized" and the value to your form's name. This links your form to Wized.

Add Wized Attribute to Form Element

{

   "wized": "Form Name"

}

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Name
wized
Copy
Copied
Value
Form Name
default =
|
values =
Form Name
Copy
Copied
Step
4

Open the Action Tab in Wized

Go to the action tab on the Wized dashboard, or click on the attribute value you added in Webflow's x-ray mode. You should see an action ready to go with your form's name.

Open the Action Tab in Wized
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
5

Configure the Action Settings

In the action tab, find the settings section and look for event settings. Add the "sf-submit" event. This tells your form to use StudioForm's submission process.

Configure the Action Settings
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
6

Prevent Default Form Submission

Check the box labeled "Prevent Default." This option stops the form from being submitted to Webflow, giving you full control over what happens after the form is submitted.

Prevent Default Form Submission
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
7

Explore Advanced Possibilities

Now that the basic setup is done, you can set up custom requests to services like Xano or Airtable. This opens up many advanced possibilities for your form, enabling you to integrate with various platforms and perform complex tasks with your data.

Explore Advanced Possibilities
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Complete List of Form Events

This comprehensive list covers all the available events for your multistep form. Each event serves a distinct purpose, helping you manage transitions, submissions, errors, data handling, and other key interactions to enhance and customize your form experience.

Custom Form Submission Handling

Thevent is triggered when a user submits the form. Leverage this event to implement custom actions or logic for processing the form data.

Event
sf-submit
default =
|
values =
sf-submit
Copy
Copied

Track Form Scrolling

This event triggers when the user begins scrolling within the form. Use it to start any scroll-based actions or effects.

Event
sf-scroll-start
default =
|
values =
sf-scroll-start
Copy
Copied

Handle Scrolling Completion

This event fires when the user stops scrolling in the form. It lets you manage any actions or updates that should occur after scrolling has finished.

Event
sf-scroll-end
default =
|
values =
sf-scroll-end
Copy
Copied

Form Transitions

Thevent manages transitions between different steps in your multistep form. Use this event to handle and customize the flow as users move from one step to the next.

Event
sf-transition
default =
|
values =
sf-transition
Copy
Copied

Error Handling for Form Submissions

Thevent fires if the form submission encounters any issues. This allows you to address errors and provide feedback to users seamlessly.

Event
sf-failed
default =
|
values =
sf-failed
Copy
Copied

Data Retrieval Management

Th event occurs when data is successfully retrieved for the form. Use this event to manage or display the fetched data as needed.

Event
sf-fetched
default =
|
values =
sf-fetched
Copy
Copied

Monitor Form Asynchronous States

This event helps you track changes in the form’s asynchronous states. This is useful for managing tasks that depend on form data being processed or fetched.

Event
sf-promise
default =
|
values =
sf-promise
Copy
Copied

Actions on Successful Data Handling

This event is triggered when a form’s promise resolves successfully. Use it to perform actions after the form’s data has been successfully processed.

Event
sf-resolve
default =
|
values =
sf-resolve
Copy
Copied

Manage Form Removal

This event occurs when a form is removed from the active view. Utilize it to handle cleanup or adjustments after the form is no longer visible.

Event
sf-detached
default =
|
values =
sf-detached
Copy
Copied

Set Up When Form is Added

This event fires when a form is added to the view. It’s the ideal time to initialize or configure form elements as they become visible.

Event
sf-attached
default =
|
values =
sf-attached
Copy
Copied

Validation Reporting

This event occurs when the form's validity is assessed. Use it to handle and display validation results, ensuring that all form data meets the required criteria.

Event
sf-report-validity
default =
|
values =
sf-report-validity
Copy
Copied

Promise Resolve in Detail

Get a Detailed Understanding of How to Use the Promise-Resolve Event to Handle Promise Resolutions in Your Multistep Form. This Guide Will Walk You Through Each Step to Effectively Integrate and Utilize Promise Handling in Your Form Setup.

Step
1

Add the Attribute

To start, add the attribute to the step(s) you want. You can apply this to specific steps or to the entire form by adding it to the form block.

Add the Attribute
Snippet

{

   "sf-promise-resolve": "true"

}

default =
false
|
values =
true, false
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
false
|
values =
true, false
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Name
sf-promise-resolve
Copy
Copied
Value
true
default =
false
|
values =
true, false
Copy
Copied
Step
2

Prevent Form Submission

Go to the form settings in Webflow and set the "Action" field to /. This ensures that the form does not submit directly through Webflow.

Prevent Form Submission
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
3

Create a Variable in Wized

In Wized, navigate to the "Variables" tab on your dashboard. Create a variable called form_data. Then, copy the code snippet from the "Generating Form Data from a Variable Function" section in the documentation and paste it into the initial value field of your variable. Save your changes.

Create a Variable in Wized
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
4

Set Up an Action in Wized

Create a new action in Wized, similar to what you did in the initial setup. Under "Events," add sf-promise, and in the action dropdown, choose to run a function.

Set Up an Action in Wized
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
4(1)

What We Will Promise

In this implementation, we will focus on ensuring that the email field does not accept any Gmail addresses. If a Gmail address is entered, the form will not proceed, and an error message will be shown.

What We Will Promise
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
5

Retrieve Step Details for Validation

Tick the "Conditional?" checkbox beneath the function. You’ll now see a conditional input field. Insert the given snippet, which retrieves details about the step where you added the sf-promise resolve attribute (in this example, Step 2).

Retrieve Step Details for Validation
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet

return e.detail.current == 1;

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
6

Add Logic for the Email Field

Next, we’ll add the logic to the email field. The given snippet prevents the form from resolving if a Gmail address is entered and displays an error message for invalid input.

Add Logic for the Email Field
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet

const email = v.form_data().{Input Name Placeholder};

const isGmail = email.indexOf("gmail") > -1;

StudioForm.demo_request_form_1.resolve = !isGmail;

if (isGmail) {

 StudioForm.demo_request_form_1.reportValidity("#Input Field ID Placeholder");

 document.getElementById("Text ID Placeholder").innerHTML =

   "Gmail not allowed, Sorry!";

} else {

 document.getElementById("Text ID Placeholder").innerHTML = "Enter a valid email";

}

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
7

Replace Placeholder Values

Replace all placeholder text with the correct IDs and class names. The first placeholder should be replaced with the name of the input field. The second one should be replaced with the input’s ID. The third and fourth placeholders should be replaced by the class names of the error text.

With these updates, you have successfully implemented a fully working promise resolve for the email field.

Replace Placeholder Values
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Step
8

Future Possibilities with Promise Resolve

This implementation demonstrates how to use resolve to block Gmail addresses, but StudioForm allows for much more complex logic using the JavaScript API.

Future Possibilities with Promise Resolve
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Managing Script Execution with StudioForm

Ensure your scripts run only after the StudioForm JavaScript API is ready by using the provided setup code. Additionally, learn how to access individual form instances to interact with specific forms in your setup.

Set Up StudioForm Loading

To ensure that your scripts execute only after the StudioForm JavaScript API is fully loaded, use the given code snippet. This snippet initializes the StudioForm array if it doesn’t already exist and pushes your code to be executed once StudioForm is ready.

Set Up StudioForm Loading

Snippet

window.StudioForm = window.StudioForm || [];
window.StudioForm.push(sf => {
 // Your code here
});

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet 2
default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Access Individual Form Instances

To interact with specific form instances, use one of these methods. Choose the appropriate approach to access and manipulate individual forms based on your setup.

Access Individual Form Instances

Snippet

StudioForm[StudioForm.keys[0]]

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Snippet 2

StudioForm.YOUR_INSTANCE_NAME

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Generating Dynamic Form Data on the Fly

Learn how to generate your form data dynamically using different formats. Follow these steps to obtain your form data as either an array or an object.

Simple Form Data (Beginner friendly)

Use the given snippet to create a flexible object with very little code. If key-value pairs exist for the same key, an array is automatically created for this key.

Simple Form Data (Beginner friendly)
Snippet

return StudioForm[StudioForm.keys[0]].data()

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Generate Form Data as an Array

Use the given snippet to convert your form data into an array. This method extracts form data entries into an array format, allowing easy iteration and processing.

Generate Form Data as an Array
Snippet

return Array.from(StudioForm[StudioForm.keys[0]].data.form.entries());

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Generate Form Data as an Object

Use this snippet to convert your form data into an object. This approach converts the form data into a structured object, making it convenient for organized data handling and integration.

Generate Form Data as an Object
Snippet

return Object.fromEntries(
 Array.from(StudioForm[StudioForm.keys[0]].data.form.entries())
);

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Generating Form Data from a Variable Function

Use this snippet to convert your form data into an object at any time. This approach + Wized variables converts the form data into a structured object, which is convenient for organized data processing and integration.

Generating Form Data from a Variable Function
Snippet

return function () {
 return Object.fromEntries(
Array.from(StudioForm[StudioForm.keys[0]].data.form.entries()),
);
};

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Advanced Features of StudioForm

Discover advanced features for managing your forms with StudioForm. Learn how to simulate submissions, set authorization tokens, and customize record data for greater control and flexibility.

Perform a Fake Submit

To move your form to the success state without triggering actual submission mechanisms, you can use the give snippet. This allows you to simulate a successful form submission while bypassing the real submission process.

Perform a Fake Submit
Snippet

StudioForm[StudioForm.keys[0]].to("done", { fake: true, skipRequirements: true });

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Set Authorization Tokens

To set the authorization bearer header token for your form, use the given snippet. This enables you to easily configure the authorization token for secure API interactions.

Set Authorization Tokens
Snippet

StudioForm[StudioForm.keys[0]].auth = {{ Your auth token string }};

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied

Overwrite Record Data

To customize the record data that StudioForm uses, add the given snippet. This command allows you to overwrite and tailor the record variable to meet your specific needs.

Overwrite Record Data
Snippet

StudioForm[StudioForm.keys[0]].record = [1, 3, 5, 8];

default =
|
values =
You can use the
xAttribute
app to quickly copy and paste these attributes if you have it installed.
Copy
Copied
Value
default =
|
values =
Copy
Copied
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.