I keep getting a "Please include an email" error when using the "create an account for someone else" workflow action

I have an element on my page with a custom state. The custom state name is “email” and the custom state type is “text”.

I also have a “create an account for someone else” action inside a workflow.

In the email field for that action I am referencing the email custom state described above.

But it keeps failing and returning an error to the console saying “Please include an email”.

See the workflow here:

See the console error here:

I am certain that the “PROFILE” element has a custom state with text containing an email because I can see it on the inspector before the “create an account for someone else” action runs. But for some reason the “create an account for someone else” action won’t recognise it.

I have seen a few other people on the forum talk about using an “email” type for the custom state instead of “text” but I don’t see that option upon creation. Maybe that is what I’m missing? Or something else?

Where Is the email originally coming from is there a reason why you are using a custom state?

It is coming from an Auth0 plugin that I am building. The plugin authenticates a user, grabs their email, and publishes it to the element on the page.

Are you sure that the state is being set?

Yep 100% sure.

I added a big pause in between so I could inspect the “PROFILE” element before the “create an account for someone else” action runs. The email is there.

Screenshot showing the email text is correctly loaded into the “create an account for someone else” email field:

But it fails just after this step, telling me there is no email :confused:

If I’m correct, the pause does not work for Workflow, only for UI elements change.

Instead of using this pause, you should use a scheduled Workflow to create the account, set it to run 10 seconds later (current time + 10s)

But when I use the debugger to step through everything we can see the email has been sent to the “Create an account for someone else” action (see screenshot of my previous post).

So the email text value is available to the action regardless of the pause because we can see it in the debugger, the action just doesn’t process it for some reason.

I also tried your solution (sending it to a scheduled backend API) but the email does not get passed through to backend workflow. It is blank.

Scheduling the workflow:

Creating the scheduled workflow endpoint:

The action settings for the scheduled workflow:

The server log showing the email field is blank:

Screen Shot 2021-02-05 at 11.07.46 am

Does it have appropriate privacy rules? To test this you can tell it to ignore privacy rules

1 Like

Try placing that text to an input in a hidden popup set to value type email.

@johnny If you’re referring to the Backend Workflow solution, I already had it set to ignore privacy rules, unfortunately it didn’t work.

@cmarchan I tried this just now, but still not working :confused:

Hi everyone,

Turns out that this has to do with the way plugins are loaded.

I submitted this as a bug to Bubble and they explained that plugins (and their data) are loaded asynchronously, while all other actions are loaded synchronously.

Put simply, that’s JavaScript speak for “Normal Actions are loaded first, while plugin actions are loaded last”.

So I triggered an event in my plugin after the data is loaded, to make sure everything was available on the front end before proceeding. This has fixed the problem. Hope it helps anyone else seeing this in the future.

It is strange that the debugger showed the email value (even though it was not accessible) but nonetheless it’s working as expected now.

This topic was automatically closed after 70 days. New replies are no longer allowed.