01 Getting Started

This tutorial covers how to validate fields on your form.
A simple form where a user will provide information to create an account and a contact will be used for demonstrative purposes. There are mandatory fields the user must complete before submitting their details.
form example
Two different Salesforce actions are configured on the submit button: create an account and a contact.
On Click action screen
Note: It is not best practice to have two separate Salesforce Actions running one after another. They should be combined into one Salesforce action node, We have separated them into two different pushes to demonstrate what issues can occur during validation.

02 Creating an Account

When users complete the form, separate fields will be used to create the account and contact.
An error message displays if the user does not provide all the information. This occurs because the missing fields are mapped in a push to Salesforce action, these fields trigger a validation action when the push runs.
Error message displayed due to not all fields being completed
If the user does not complete the personal details, the create account action will run but not the creation of a contact. This is because only the validation for creating a contact failed. To prevent this from happening, we need to create an action to ensure all fields pass validation before the user can submit.

03 Create an On Click Action to Validate all Fields

1. Navigate to the On Click action screen.
2. Click the X icon to insert an action to run before the Salesforce Action pushes.
Break link between nodes
3. Click the + icon next to Start. The Add Node screen opens.
Click plus icon
4. Use the search field to find the Validate fields option and click Next.
add validate fields node
5. Use the Select Parameter from the Dropdown menu to select what fields you want to validate. For example, the page.
  • You can validate all the fields on your strip, on your page, specific fields, or a number of fields.
parameter options
6. Another drop-down field displays, use this drop-down to select the page you want to validate. For example, the home page. This field is dependent on the previous selection made. Click Next.
choose page
7. Type in a Tag name and click Insert.
Add a tag
The Node is added to the On Click Action screen. You can now insert nodes to run if the content is valid or invalid.
Added nodes

04 Inserting a Toast

You can insert a toast to display a message while the validation is running.
1. Click on the + icon next to Validate. The Add Node screen opens.
Plus Icon next to Validate
2. Use the search field to find the Show Toast option and click Next.
show toast option
3. Type in the message and click Next.
Configure message
4. Add a tag and click Insert.
Adding a tag for the show toast node
The Toast is added to the On Click Action screen.
Configured toast added to on click action screen

05 Connecting Nodes

1. Click the circle icon of one node and drag the cursor to the connecting node.
How to link nodes

06 On Invalid Message

You can insert a toast to display a message if the fields are invalid.
1. Click on the + icon next to On Invalid. The Add Node screen opens.
On invalid plus icon
2. Select the Show Message node and click Next.
show message node
3. Configure your message and click Next.
Configure message
4. Add a Tag and click Insert.
add a tag
The Message is added to the On Click Action screen.
5. Click Apply.
Added error message

07 Preview the Project

1. Click Save and Preview.
If a user does not complete all the fields and clicks the button. An error message displays.
The toast will display whether the fields are valid or invalid as we configured the toast to display during the validation process. 
No Salesforce Action will run because some of the fields on the page are invalid.
preview of form
If all the fields are completed the Salesforce Actions will run.
completed fields
Remember to consult your Integration Logs to view successful actions.

08 Got Feedback?

Additional Resources