Evaluate(@NameLookup ) not returning anything :(

I’m sure this is something silly but my brain is NOT cooperating today (dr appt = no food) so I would really appreciate a nudge in the right direction - here’s my formula which is returning type mismatch

Forall grpMembers In strGroupMembersArr

	adress = grpMembers

	sFormula = |@NameLookup([Exhaustive];"| & grpMembers & |";"FullName")|

	eMailAliases = Evaluate(sFormula)

	'If D="Management"  Then

	'	MgmtAliases=Arrayappend(MgmtAliases,emailAliases)

	'Else

	SystemsAliases=Arrayappend(SystemsAliases,emailAliases)

	'End If

and I expect it to return an array… but it doesn’t

plus the actual statement in sFormula looks like it has double quotes:

@NameLookup([Exhaustive];““O/=Nancy Drew OU/=Domain””;“FullName”)

Subject: try this

Forall grpMembers In strGroupMembersArr		sFormula = |@NameLookup([Exhaustive];"| & grpMembers & |";"FullName")|

	eMailAliases = Evaluate(sFormula)

	If Isempty(SystemAliases) Then

		SystemAliases = emailAliases

	Else

		SystemAliases = Arrayappend(SystemAliases, emailAliases)

	End If

Subject: RE: try this

Thanks!!

that didn’t trip (thx) an error but I’m only getting one value, the first value.

According to the documentation it should be able to return a text list, correct?

Subject: RE: try this

@NameLookup function in the Designer help, suggested corrections in red.

In addition to the changes suggested below, I also suspect that the information under “[Exhaustive]” about which directories are searched may actually apply to @NameLookup generally, and the only difference is when the function stops searching for each username.

Also, the advice to use @Text to display the value with @Prompt is just goofy. First, it’s not necessary because the value is already text. Second, it’s not enough because the value is often multivalued – they would need to @Implode it instead. Third, why do we bother to tell them how to display this function’s result when it is not different from how you would display a value generally?

[ lookupType ]

Keyword. Specifies the type of lookup to perform. Supply one or more of the following keywords, separated from each other with : (colon):

[Exhaustive]

If you specify [Exhaustive], the search for each value in the username argument continues through all directories, even after a matching username has been found. Without this option, the search for each username ends with the first directory that contains a match (however, multiple matches may still be returned from that directory). Searches all Domino Directories listed in the Notes Directory Assistance and returns all information in a text list. This keyword returns values from the local Names.nsf database as well as the mail server’s directory. If the mail server is unavailable, or the Recipient name type ahead setting in the current location document is Disabled or Local Only, it retrieves values from the current name server. If you are using LDAP, it also retrieves values from the LDAP directory. The user’s value is omitted if there is no match found.

Without the [Exhaustive] argument, a value in the user’s local address book may hide values in the server directories. For instance, suppose usernames = “Smith”, and the current user has a “Mary Smith” in their local address book. Unless you specify [Exhaustive], @NameLookup will not notice the entry for “George Smith” in the server address book, and will only return information for Mary.

[TrustedOnly]

Searches only those Domino Directories that contain trust information and returns a list of single text values for each specified user name. An empty string is returned for no match found. Corresponds to NAME_LOOKUP_TRUSTED_NAMESPACES flag for Notes API.

username

Text or text list. Specify primary or alternate Notes/Domino user names to retrieve their information from the Domino Directory.

itemtoreturn

Text. Item or field name from the Domino Directory Contact record that you would like to retrieve information from.

Return value

valuelist

Text list. When other flags besides [Exhaustive] have been specified, @NameLookup returns a list of single values for each matching user. If a given username value matches multiple users, one entry will be returned for each matching user. Unless [Exhaustive] has been specified, an empty string is returned for usernames for which no match was found. When [Exhaustive] has been specified, @NameLookup returns a list of all information matched for the specified user. No value is returned for unmatched users. To display the return values in a dialog box using @Prompt, enclose this function in an @Text function.

In no case will more than one value be returned from each matching contact document. If the requested field is multivalued (e.g. the FullName field), only the first value in the field is returned.

Subject: RE: try this

Ah yes, according to ‘well read’ documentation. D’oh.

Your changes are much better…

So would it be poor practice to just search the NAB $Users view for dept and create an array that way to reference?

Now that I’ve had some coffee I think that sounds ok - we don’t have a big organization, just a lot of email to process and sort.

THANKS!!

Subject: RE: try this

what exactly are you trying to do?

Subject: RE: try this

First - I am taking an absolutely enormous, unwieldy journal db and searching for mail sent to/from GroupA and sticking that in a folder.

Then from those emails, I need to do 2 things -

-search for mail sent from anyone in groupA to groupB and vice versa and stick in a folder

-also need to search groupA emails for content (hostile work environ, job search, etc) and placing those in another folder.

anything that does not meet those requirements, should be deleted

The journal db captures ALL email. And from talking to my admin, that all it’s going to do.

Subject: RE: try this

so I’m thinking I’m just going to take each document, collect the from, principal, sendto, cc, and bcc fields and do a namelookup on dept if it’s groupA then move it to a folder and if not dump it.

ugh.

I guess I’m thinking there must be a more elegant solution… I feel like I’m wasting a lot of time trying to find it as opposed to just doing it.

I may just have to search $Users after all.

Subject: RE: try this

Why are you looking up each name as you go along? Why not load the groups into memory as a list datatype so that you can instantly tell whether any given name is a member of a particular group?

BTW if you’re going through historical information for legal discovery, you should probably have a copy of the list of names in each group yourself, because the relevant information is who was in these groups at the time, not who’s in them now.

Subject: RE: try this

yes… that thought occurred to me too about loading them initially.

listName( listTag ) = value

where listtag and value are equal to the members of the groupA list, correct? The only issue is the aliases then. thinking out loud here - so using $users, searching based on department and compiling the list from there, that should be acceptable?

I don’t know why I’m being so thick about this… I just have it in my head that there must be a more elegant solution and it’s really stalling me… when I should just get started and do this already.

This is not for historical/legal purposes, just for review. Thanks for the comment though.

Thank you for your patience and input… I REALLY appreciate it.

Subject: RE: try this

There are different versions of the name that might end up as part of the sendto address, yes, and so when you scan the groups you might want to find the corresponding person records and add all their names to the list, as well as their internet address if you can determine it – it should be stored in there. The thing is, an internet email can be addressed fairly oddly and still get to someone, so if a person sends to someone in their personal address book with an internet email, it might be hard to tell for sure who it was to.

Subject: RE: try this

I’ve gotten a little further but have a ?

So I’ve searched $Users for a particular department.

I’m going through the view entries and the first columnvalue but I’m not getting all the values that I see… what am I doing wrong?

Subject: RE: try this

derrrr…

this is what I’m looking for…

	xnamearr=Evaluate(viewNAB.columns(0).Formula,entryNAB.document)

Subject: Evaluate(@NameLookup ) not returning anything :frowning:

Don’t hold me to this but I believe ArrayAppend is throwing the error because the initial array is empty so there is nothing to append to. Try adding a dummy value to the array at the begining of your code then after you append all of your values just remove the dummy one