Form submit success/error

Hi. I’ve tried to use the form state options, and I’ve tried to use the “action after submit” and “action after error” options and none of these things seems to work when a form is submitted.

Currently, I can submit a form, and it updates the database, but I am unable to determine how to notify the user of success/error.

What is the recommended way to handle success/error on form submission so that a user can be informed if the request was successful or not?

Thank you!

1 Like

Hi @kevinwasie :wave:

You can do this with conditional display. For example, hiding your form container after a successful form submission, and displaying a success message instead.

In the example below, we don’t hide the form container after the form submission because the user might want to update another record, but we want to display a success or error message when they submit the form.

So we created:

  • two containers: one with the success message, one with the error message, and
  • two boolean variables with a default value of false which we change in the workflow to trigger the display of the correct message:

The mileage updated variable is changed to true on success. The formError variable is changed to true on error.

Thank you, Joyce.

What is the logic for the “action after submit”/“action after error” fields on the form? What do these do, if not what I’m trying to do here?


You mean these settings? :point_down:

They no longer do anything :grimacing:

We will retire these settings and update all the Form Containers this week so that everything goes through Workflows instead.

Got it. Thank you, Joyce!

1 Like

I’m also experiencing some issues where the submit button doesn’t actually trigger the form container workflows. Should I just be setting up workflows on button press instead?

Hi Kyan, I wouldn’t do that, no.

If you need to submit a form, I would have the Workflow on the Form Container with an “On Submit” trigger.

If you’ve done that and you’re experiencing an issue, could you start a new thread with a short loom video explaining how you set up the form, the workflow, and what you’re trying to do?

Ok, I actually just realized that an issue was happening with this form where an “Internal Error” was preventing API calls from going through. I tried toggling “Make this request through a server” on and off and it worked! I don’t have an explanation, but figured I’d share

Ah ok great, glad you found the solution! And thanks for taking the time to share :slight_smile:

It means you were trying to make a client-side API call to an API that only access server-side requests.

By default, being a frontend builder, WeWeb will make client-side API calls. Because many REST APIs only accept server-side calls, we built a feature that allows you to make server-side calls if you need to.

However, if you didn’t want your call to go through a server of ours, you could also contact the API admin to allow the “” domain to make client-side requests.

@Joyce is the reason that you do not want to attach the workflow to the button because it does not trigger the form field requirements?

Is there any other reason?

1 Like

Yes, exactly. I’m not aware of any other reason but let me check with the tech team :slight_smile: