Manage Learn to apply best practices and optimize your operations.

Looping through @Implode and @Explode

Learn how to perform multiple lookups in one shot.

Editor's Note:
This tip is most useful for versions below ND6. In ND6, it will work, but @While and @For will perform iteration.

Most of time we have a field that has multiple values, and we want to use each value as a key to perform lookups. But @DBLookup does support multiple lookups in one shot. So we need to use LS for it. We can also do this in formula with the help of @Implode and @Explode.

(@DbLookup( "Notes" : "NoCache" ; @dbname ;
"Viewname";MultivalueField ; "FieldToFetch");";");";")


You may want to try using this:

@Explode(@Implode(@DbLookup( "Notes" : 
"NoCache" ; @dbname ;"Viewname";MultivalueField ; 

I've been told that the code above works unless one of the individual items generates an error -- then everything after that is blank. The Domino programmer I talked to said he has tried using this type of code, but ended up changing it to do a loop through each item in the Lotus Notes field so he could handle any error.

Again, this is hearsay as I haven't tried it myself!
—Dave F.

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

This tip was submitted to the tip library by member Smita Agarwal. 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 Notes Domino Formula Language



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...