Jump to content

Need help fixing script to search by email address


This topic is 2816 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I apologize if this is in the wrong forum.

I'm using a search script and it won't work with email addresses.  I have found information about the @ being a wildcard, so it won't work when searching for emails.  I understand why, I just don't understand how to modify what I have to make it work.  Here is my script.  Any help would be appreciated.  Be nice, I'm learning.

I've attached a screen capture here.

Thanks for your anticipated help.

screen cap.jpg

Link to comment
Share on other sites

You need to escape the @ character. Either enter it as \@, or make your script do it for you by:

Set Field [ Students::Email ; Substitute ( Search::Search Field ; "@" ; "\@" ) ]

--
P.S. Next time please post your script as code, not as a picture.

Link to comment
Share on other sites

Or you could set indexing to "unicode" in the field definition (thanks to JFS for the reminder...)

This is especially helpful when such an email field is accessible in search mode for users...

Link to comment
Share on other sites

27 minutes ago, Lem Alpha said:

Or you could set indexing to "unicode" in the field definition (thanks to JFS for the reminder...)

This is especially helpful when such an email field is accessible in search mode for users...

I would avoid changing the field indexing. If you do that, then it also makes it case sensitive, which can be confusing to users as well.

Link to comment
Share on other sites

True. But I have seldom seen emails encoded with upper case, so I think the benefits of users being able to search for emails using @ are greater.
And just making this field an auto-entered calc Lower ( Self ) would prevent indexing upper case chars.

I was specifically speaking of users manually searching for emails, of course.

Link to comment
Share on other sites

This is also a good remark.

In my case of making it easier for users to search for emails, it was never an issue because when someone puts in the @ it means they put in a complete address, so there shouldn't be any parasitic results.

But of course, for such a scripted search, it would not be bulletproof then.

Thanks for pointing out these caveats, both of you.

Link to comment
Share on other sites

This topic is 2816 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.