Manage Learn to apply best practices and optimize your operations.

Pull a specific element from a list

If you are given a list of items, do you know how to pull out the 1st, 2nd, 3rd, 4th, etc. elements? This tip shows you how.

VIEW MEMBER FEEDACK TO THIS TIP

If you are given a list of items, do you know how to pull out the 1st, 2nd, 3rd, 4th, etc. elements? This tip shows you how.

Assume that AdjusterList is a list of people's names, and that AdjCount is the number of elements in the list:

Computed formula for AdjCount: 
@Elements(AdjusterList)

To get the 2nd adjuster in the list, use:
AdjNum:=2;
tempadj:=@Subset(@Subset
(AdjusterList;-(AdjCount-(AdjNum-1)));1);
@If(AdjNum>AdjCount;"";
@If(@IsError(tempadj);"";tempadj))

To get the 3rd adjuster in the list, use: 
AdjNum:=3;
tempadj:=@Subset(@Subset
(AdjusterList;-(AdjCount-(AdjNum-1)));1);
@If(AdjNum>AdjCount;"";
@If(@IsError(tempadj);"";tempadj))
  

MEMBER FEEDBACK TO THIS TIP

A simple way to pull out an element from a list is to use List[n] formula. For example, if you put this formula in a computed text = AdjusterList[1] it will give you element number 1.
—Glenn L.

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

This tip was submitted to the SearchDomino.com tip exchange by member Tandy Wine. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on Lotus Notes Domino Formula Language

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close