[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Checking values against textfield

Hi!
I am very new to lotus notes and was wondering if anyone can help me out with this.
I have a textfield in Notes. (Admin)
There are about 5 email address in the format: USER1/DEVT/SINGAPORE, USER2/DEVT/SINGAPORE etc..

Is there anyway i can do a "split" and compare with another textfield called : CreatedBy?

Of course it has to "loop" through the whole (Admin) textfield.

Please advice.
0
darenceang
Asked:
darenceang
1 Solution
 
fgrushevskyCommented:
Do you know if "Admin" field is a list (multivalue) field or a text string?
if it is a list you can use @member(createdby;admin)
if it is a string you can use @contains(admin;createdby)
0
 
qwaleteeCommented:
Usually, you can do a simple FIELD1 = FIELD2, even if FIELD2 has a list of names.  That's because Notes compares fields with multiple values against each other, and if there is one corresponding match, then they're considered a match. Examples:

FIELD1 is OneA : TwoB : ThreeC
FIELD2 is TwoA : OneB : ThreeC

Notes evalues FIELD1 = FIELD2 as (OneA = TwoA) _OR_ (TwoB = OneB) _OR_ (ThreeC = ThreeC)
Even though the first two possibilities don't match, the third one DOES match (ThreeC = THreeC) so they are considered a match.

In your case, it is more like:
FIELD1 is User2
FIELD2 is User1 : User2 : User3

When Notes does the comparison, it notices that they are "unbalanced," because FIELD1 has onlyo ne value (FIELD1 is like CreatedBy), while FIELD2 has three values (like Admin). So, in order to make them "matchable," Notes treats FIELD1 as if the value is repeated. So it is as if the values are:

FIELD1 is User2 : User2 : User2
FIELD2 is User1 : User2 : User3

Thus, the comparison is (User2 = User1) _OR_ (User2 = User2) _OR_ (User2 = User3)
The middle one matches, so it is considered a match. If FIELD1 contained the value User4, then the comparison would be:
(User4 = User1) _OR_ (User4 = User2) _OR_ (User4 = User3)
None of those mtach, so it would return false.

As I said, the simple upshot is that you can probably just say:
Admin = CreatedBy

Or,
@If(
  Admin = CreatedBy;
    "The CreatedBy value matches one of the admin values";
   "The CreatedBy value does NOT match ANY of the Admin values"
)

This is called "list processing," a comparison of multivalued (List valued) fields. More complicated compraisons are possible, without resoprting to "split." Note that lists are comparable to arrays, they are not a single string with a separator value, as you might find, in, say, JavaScript procesing of a field value.

If you are using LotusScript, it is treated as a true array, and you can loop over it (For, While, Do, whatever loop construct you fancy), using array subscripts.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now