You are viewing limited content. For full access, please sign in.

Question

Question

Forms - Send email if variable does not contain certain text

asked on December 4, 2024

Hello,

I have a form, and in the Process Diagram, I'd like to use an exclusive gateway to send an email if the email address captured on the form does not contain a certain domain name. So for example, I want to send the email every time, except for when the domain and the extension are "company.com." If it's anything else, I want to send the email. 

I don't appear to be able to do that using the Process Diagram as is, as I can't use "contains" in my condition. Feels like I need to use a hidden field that populates with a certain value when the email address ends in "company.com," but I've been staring at it for a little while and can't seem to make it work. Any advice?

Thanks!

0 0

Answer

SELECTED ANSWER
replied on December 4, 2024

A hidden field with a calculation on the form is what I usually use.

Something like the following, where the number in the RIGHT function is the length of the text you're trying to match.

=IF(RIGHT(Email,12) = "@company.com", "Yes", "No")

Of course, the output values can be whatever you want, I just put Yes/No as an example.

There's actually a few ways you could do this depending on how exact/specific you want to get as far as case-sensitivity, ends with (RIGHT) vs contains (FIND), etc.

 

2 0
replied on December 4, 2024

Hi Jason,

Looks great! I'm testing it now and it's working as expected. What would be the best way to make this not be case sensitive? So that regardless of the case of the text entered as the email address, I'll get the value I want from the formula?

0 0
replied on December 4, 2024

You can wrap your email variable in LOWER()

=IF(RIGHT(LOWER(Email),12) = "@company.com", "Yes", "No")

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.