A required field is empty or in the wrong format

:bullseye: What is your goal?

Hi everyone :waving_hand:

I’m working on a workflow in Make that I need to automate, and I’m having an issue when trying to send an email to the professional selected as the assignee.

The workflow I need is:

A record is edited/updated from InstaApp.
A professional/assignee is selected from a list in the form.
Once the record is updated, Make receives the information through a webhook.
I then perform some queries using HTTP modules to retrieve the necessary information.
Finally, I need Gmail to automatically send an email to the professional who was selected, notifying them that they have been assigned a new task.
For example:

“Hi, you have been assigned a new task. You can review the request details in InstaApp.”

The problem occurs in the last Gmail module (Send an email). The scenario runs successfully until it reaches Gmail, but then I get the following error:

“A required field is empty or in the wrong format”
“Invalid email address in parameter ‘to’.”

I’m using an Iterator because the assigned professional comes from a list. My main question is how I should configure the mapping so that, based on the person selected in InstaApp, Make can correctly retrieve their email address and use it in Gmail’s To field.

I’ve attached a screenshot of the scenario and the error.

Could anyone point me in the right direction regarding the correct way to structure this workflow or retrieve/map the email address of the selected professional?

Thank you so much!

:thinking: What is the problem & what have you tried?

The problem occurs in the last Gmail module (Send an email). The scenario runs successfully until it reaches Gmail, but then I get the following error:

“A required field is empty or in the wrong format”
“Invalid email address in parameter ‘to’.”

:clipboard: Error messages or input/output bundles

A required field is empty or in the wrong format
Validation failed for 1 parameter(s).

Invalid email address in parameter ‘to’.

Code: BundleValidationError

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hi @constanza_romero, Welcome to the community.
For better asessement,
Can you share the screenshots of the mapping of values in GMAIL module?
Much better if you can share here the link of the scenario to expedite the situation.

All the Best,
-John

Hi @Johnai.tech, thanks for the welcome I don´t know if i can share the link of the scenario because have a sensitive information , but I have in gmail to :

switch(
trim({{7.attributes.profesional_asignado}});
“Rafael”; “[email protected]”;
“Gutierrez”; “[email protected]”;
“Liliana”; “[email protected]”;
“Mariana”; “[email protected]”;
“Eduardo”; “[email protected]”;
[email protected]
)

But when I leave only one email address in the mapping, the workflow works. However, I need to keep the entire list because my boss will assign a task to a specific person. When she selects a name in the “profesional_asignado” field in the form, I need the email to be automatically sent to the selected person.

So basically, I need Make to identify which professional was selected and then retrieve and use that person’s email address in the Gmail module.

I trie to use the switch and trim, but doesn’t work

Let us test, How about you insert a set variable module before the gmail module then use the above-mentioned formula expression in the set variable module and then on Gmail module, map the email from set variable module

By following this test, unlink first between iterator and gmail module, and lets see the outcome of the set variable module using your above-mentioned formula expression (Switch-trim)