Symptoms
When using the Gmail Send Email action in your Zaps, you see the error message "The value in the "To field is invalid". You may see this error when setting up a Zap or in the details of a Zap run in your Zap history.
Causes
This happens when:
- The mapped field from the previous step in the To field is blank or contains a text value such as a full name.
- Gmail requires a value in this field to send an email.
- The email address in the To field is not a valid email address.
- There are multiple email addresses in the To field, and they are not separated by commas.
How to fix it
To fix this issue:
- Ensure the data from the previous step is consistently sent to the Gmail step, or replace the current mapped field with one that consistently provides an email address value.
- Re-test your previous step to ensure you have the most current fields.
- If you cannot change the current mapped field, you can either:
- Add a step to set a default value as a fallback whenever your mapped field does not have any data.
- Add conditional logic using a filter or branching logic with paths to your Zap. This will allow you to define what the Zap should do if the To field does not receive data from the previous step.
- If the mapped field contains the email address within a body of text, add a Formatter step to extract the email address using the text transform.
- If you have mapped multiple fields containing different email addresses, add commas in between to separate the email addresses.