How to easily add server-side logic to your forms

Introduction
How to easily add server-side logic to your forms

Implement business logic, advanced validations, data enrichment... and a wide variety of functionalities to customize your form's behaviour without writing a single line of code.

Arengu's editor allows you to add actions in different stages of your form, and build easy and quick integrations with many external providers. Discover how!

Connect your forms and flows

To link flows to your form, you just need to go to Forms, open form's edition and click on Flows icon, on the light grey menu. Remember that they should be already created!

To connect a flow, you just need to click on the drill down icon of the stage where you want to execute it, and choose it from the list!

Once you link a flow to a form stage, you will modify the form behaviour when someone clicks the "Continue" button. This means the flow will be executed before allowing the user to continue to the next step.

Form stages you can execute flows

If this is your first time using Arengu, maybe you still don't know when to execute flows or some kind of actions. Let's see in detail each stage and include some common examples!

1. Between form steps flows

These flows are executed between form steps, just before the user goes to the next one. This means that all of them are going to be executed when user clicks on the next step button.

Common flows to run on this stage are:

  • User verifications. Verify user email address or phone number, to check if provided info is valid, correct and real, avoiding fraud and fake users.
  • OTP generation. Generate custom one-time passwords (OTPs) and send them to our users by email or SMS.
  • Check your users database. Find out if a user is already registered in your database, and make a redirection to log them in instead of displaying a sign up form.

For example, if you are building a passwordless login using an email OTP, your Step validation flows stage should be similar to this:

2. Before form submission flows

These flows are executed just when the form is submitted, but before the user receives a failure or success response.

Common actions to include on this stage are:

  • Set cookies. Configure authentication cookies to keep user's session open.
  • Make redirections. Send user to a destination domain or URL.
  • Send data to call center. Connect Arengu with your call center's API.
  • Create an account. Signup or login the user on your website's database.

For example, we can check an OTP, make login redirections and set session cookies on a before form submission flow like this:

3. After form submission flows

These flows are executed only when the form is successfully submitted. This means that the user has already sent the complete form and its content is valid and admitted.

Useful and common flows on this stage are automated tasks like:

  • Welcome emails. Send an automated welcome email to your new users, triggering an integration with MailJet or SendGrid.
  • Create contact in CRM. Create a new register in your content manager, making easy integrations with HubSpot or any other one with an API.
  • Real time notifications. Get customizable notifications with Slack or Telegram when a user signs up.
  • Data enrichment. Automate the return of information of the provided company from its website domain or about a person from a corporate email.

For example, after someone signs up, you can enrich information using Clearbit, create a contact in your CRM and automate notifications with Slack.

Do you want to try it? Sign up free or book a demo with us!

Author

Andrea L. Lozano

Content Specialist @ Arengu.

View Comments
Next Post

Product Updates - April 2020

Previous Post

How to reference forms and flows variables in Arengu