Manage Learn to apply best practices and optimize your operations.

Create a computed Lotus Notes field to list Personal Address Book names

Find out how to create a computed Lotus Notes field that generates a complete list of users in a specific Personal Address Book (names.nsf) group.

I recently needed to compose a computed Lotus Notes field that would list the Lotus Notes Name of every user in a particular group -- called "IT All" -- in my Personal Address Book (also known as the Domino Directory or names.nsf file).

I knew the group contained nested groups and I wanted to include the individuals in those groups as well.

Using several @transform commands and an @while loop, I was able to achieve this. The following Formula language code was the value of a computed, multi-valued text field.

groupname:="IT Programming";
startlist:[email protected]([CN];
"names.nsf";"(Groups for DbLookup)";groupname;
"Members")); @If(@IsError(startlist);"not found";@Do(

testlist:= @Transform( startlist ; "x" ;
templist:= @Name([CN];@DbLookup
(Groups for DbLookup)";x;"Members"));

LoopAgain:[email protected](@IsMember("GroupFound";testlist);
LoopAgain= "Yes";
startlist:[email protected]( startlist ; "x" ;
templist:[email protected]([CN];@DbLookup
(Groups for DbLookup)";x;"Members"));
testlist:= @Transform( startlist ; "x" ;
templist:= @Name([CN];
"names.nsf";"(Groups for DbLookup)";x;"Members"));
LoopAgain:[email protected](@IsMember("GroupFound";


This won't work well if you have a very large Personal Address Book. I suggest keeping the Domino Directory on a button that only executes when you click on it (to build/refresh the list). Using this code in a computed Lotus Notes field on the form would hinder application performance if it fired every time you opened a Lotus Notes document that contained it. Avoid keeping @DBLookups in computed Lotus Notes fields on forms.
—Andrew B.


I believe this is a simpler form, and it sorts the user names in alphabetical order:

Group := "IT Programming; 
Server := ""; 
Database := "names.nsf"; 
@Sort(@Name([CN] ; 
@ExpandNameList(Server : Database; Group)))

I can't remember where I found the @ExpandNameList command -- it might have been on SearchDomino or IBM DeveloperWorks. My notes suggest that it's been around for at least two years.
—Ross B.

Related resources from

Do you have comments on this tip? Let us know.

This tip was submitted to the tip library by member Tandy Wine. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Dig Deeper on Lotus Domino Directory

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...