Modified: Add a name to exising data in a field

Hi there,

We have a number of documents with an editable ‘Names’ type field called Project Managers - it allows multiple values - Managers’ first and last name appear and entries are separated by commas.

For a particular project it is desired to add a name of a person as proj manager.

So let’s say the current contents of ProjectManager field are:

John Doe, Jane Doe

I ran the agent below:

List1:= @Explode(ProjectManager);

List2:= List1 : “New Manager”;

FIELD ProjectManager:= @Implode(List2; “,”);

SELECT @All

Now the field has the following:

John, Doe, Jane, Doe, New Manager

Is there a way i could retain the original names of John and Joe by removing the commas between first and last names?

Otherwise is there a simpler way of just adding the additional manager to the field?

Thanks again for all your help!

Ayaz

Subject: Add a name to exising data in a field

But now I have discovered that it separated the firstname and last name by commas after it ran @explode - this will lead to problems when notifications get sent out to whoever is listed as proj manager … Is there a way to keep the space together with first and last name as a single entry after @Explode runs?

Subject: RE: Add a name to exising data in a field

Use the 2nd parameter of @Explode to indicate which character(s) will be used as delimiters between multiple values. From Designer Help on @Explode:

Text. Optional. One or more characters that define the end of an element in string. The default separators are " ,;" (space, comma, semicolon), which means that Lotus Domino adds a new element to the text list each time a space, comma, or semicolon occurs in the original string. When you use more than one character to specify separators, each character defines one separator. For example, the specification “and” breaks the string at each occurrence of “a,” “n,” and “d”; it does not break the string at each occurrence of the word “and.” The newline is a separator, regardless of the specification of this parameter, unless newlineAsSeparator is specified as False.

Subject: RE: Add a name to exising data in a field

Thanks Cesar! It finally worked …

Subject: Use the FIELD reserved word

You must use put the reserved word FIELD in front of field names. In the following formula, ‘List1’ is a variable name while ‘List2’ is a field name.

List1:=“a”:“b”;

FIELD List2:=List1;

Subject: RE: Use the FIELD reserved word

That did it!

Thanks a lot Lawrence!