Home > Domino Tips > Developer > Formula > Retrieve Lotus Notes names from a nested group using @DBLookup
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

FORMULA

Retrieve Lotus Notes names from a nested group using @DBLookup


Mike Bryant
10.30.2007
Rating: -3.00- (out of 5)


Lotus Notes, Domino, Workplace and WebSphere tips and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


VIEW MEMBER FEEDACK TO THIS TIP
Having problems using the @DBLookup command to retrieve a list of Lotus Notes names from a group that contains other groups (also known as a "nested group")?

This Formula language code retrieves the list of values in a Lotus Notes nested group, and then adds them to a list one by one -- as a common name if it's a person, or by looking up the values if it's a group.
Related resources from SearchDomino.com:
Fast Guide: @DBLookup lessons

Tip: Expand group members and nested groups using Formula language

Crash Course: Lotus Formula language coding primer

Lotus Notes Domino Formula Language Reference Center

All you need to do is:

  1. Copy the Formula language code below.
  2. Paste it into a computed, multi-value field.
  3. Change the group name to match yours.
  4. Run the code.

You can also add error trapping for the lookups as needed.

db := "names.nsf";
svr := @Subset(@DbName;1);
luKey := "YourGroupNameGoesHere";
List := @DbLookup("":"NoCache"; 
svr: db; "($VIMGroups)"; luKey; 3);
@Unique(@Name([CN]; List));

@For(n := 1; n <= @Elements(List); 
n := n + 1; @If( (@Left(List[n] ; 2) = "CN") ; 
temp := temp : @Name([CN] ; List[n]); 
temp := temp : @Name([CN] ; @DbLookup
("":"NoCache";svr:db;"
($VIMGroups)"; List[n] ; 3))
)
);

@Sort(temp)
Note: This tip will only work if you are using Lotus Notes Domino R6.x or greater. I know this may not always work for everyone, but it solved a lot of headaches for me.

MEMBER FEEDBACK TO THIS TIP

You could also use the undocumented @ExpandNameList function:

@ExpandNameList
(ServerName;GroupName) 

This function is undocumented, so it's not officially supported and may go away in a future release. It does, however, still work in Lotus Notes Domino 8 and has been around at least since version 5. Most likely, it won't be removed soon.
—Tim T.

******************************************

You could also use the following Formula language code:

@Sort(@Name([CN] ;
@ExpandNameList(Server : 
Database; Group))) 

—A.L.

******************************************

I believe this is a simpler form:

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

I can't remember where I found the @ExpandNameList function; it might have been on SearchDomino.com or the IBM DeveloperWorks page (it isn't in 6.5.1 Designer Help). My notes suggest it's been around for at least two years.
—Ross B.

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

This tip was submitted to the SearchDomino.com tip library by member Mike Bryant. 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.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Formula
Formula language button manages Deny Access list searches
Create a computed Lotus Notes field to list Personal Address Book names
Show multiple Lotus Notes document fields in a single view column
How to send a document as a link in a Lotus Notes email
How to generate formatted sequence numbers with Formula language
A simpler pagination view for Lotus Notes documents on the Web
A bevy of Notes/Domino development tips
Easily implement attachment fields in a Web form using Formula
Programmatically create a shortcut for Lotus Notes
Universal @Formula for converting list synonyms

Lotus Notes Domino Formula Language
Stop response documents from showing in a Lotus Notes form
Formula language button manages Deny Access list searches
Add a program doc to compact Lotus Notes databases automatically
Top 10 Lotus Notes Domino programming and development tips of 2007
Top 5 @DBLookup tips
Create a computed Lotus Notes field to list Personal Address Book names
Show multiple Lotus Notes document fields in a single view column
Lotus Formula language coding primer
How to send a document as a link in a Lotus Notes email
@DBLookup lessons

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts