DBLookup - Matching usernames

I have a login form where users log in with a username and a password. Upon login (authenticated), they should be able to change their preferences. I am having problems with the dblookup where I’m trying to match the username the user is entering with the list of usernames in my view (instead of the result, the username, I’m getting error). What is wrong with my code/logic?

Any help will be much appreciated. Thanks in advance.

The code in the text-computed for display field is:

_loggedUser: =User_name; // User_name is the value of another field, the field where the user enters its username.

_res:=@DbLookup(“”:“”; “”:“”; “Select Users By FullName”;_loggedUser;1);

@If(@IsError(_res); “Error”; _res)

Subject: DBLookup - Matching usernames

You have to be careful with usernames. They can exist in multiple forms

Common: Richard Schwartz

Abbreviated: Richard Schwartz/RHSC/US

Canonical: CN=Richard Schwartz/O=RHSC/C=US

The search string that you pass to @DbLookup has to match the format of what is stored in the view - and it can matter whether the view is referencing a name stored in a text field or a name stored in names field.

The @Name function provides options to [Abbreviate] or [Canonicalize].

-rich