Reputation: 42
I have a multi-value field where users are able to enter multiple values. The field is a Name value field which holds the users email address. I am wanting to have the email address listed as the user's internet address and not as their organization unit/organization address. Initially it appears as "Jane Doe/Sales/USA" and I want to have it listed as [email protected]
This field will hold multivalues so it could be Jane Doe/Sales/USA; Fred Smith/Sales/KNC; Tom Jones/Accounting/ING
First off, is there a way of getting the internet address to be listed from the names field? I tried a couple of things that were supposedly going to display the internet address, but it didn't work.
I had a previous single value field and used the following formula to display it as an internet address: Here is the formula I used. Hold Name listed the users name as their first name and last name.
HoldingLeft := @Left(HoldName; " ");
HoldingRight := @Right(HoldName; " ");
CompleteName := (HoldingLeft + "." + HoldingRight + "@newplace.com");
CompleteName
Since I am not familiar with lists in formula language, what is the best way to get the result I am wanting.
Your comments are appreciated. Thank you, Jean
Upvotes: 1
Views: 697
Reputation: 30960
This is a way to convert the fully qualified names into email addresses:
@If(FieldWithNames = "";
"";
@Replace(@Name([CN]; FieldWithNames); " "; ".") + "@newplace.com")
Assuming the names field is called FieldWithNames
then we first test if it's empty. If yes we return an empty string. If no we convert the list of fully qualified names to a list of names only. Then we replace all spaces with "." and add the domain. We are lucky because @Name and @Replace can deal with lists.
This is a way to read the internet email addresses from directory for fully qualified names:
@If(FieldWithNames = "";
"";
@NameLookup([Exhaustive]; FieldWithNames; 'InternetAddress'))
We are lucky again as @NameLookup accepts as second parameter a list. It reads for every entry the internet email address from directory and returns the result as list.
In other cases, you might have to handle every entry of a list separately. Then you'd use @Transform(list; "variable"; [code doing stuff with variable])
Upvotes: 3