Show data in a view column

Dear Team,

I have created a view and i want to display data in a view column but problem is a single field show multiple values like aa@gmail.com,ab1@aa.com, cc@gmail.com, 123@g.com . but I need only show in a column only gmail.com else not required in the view column.

Please help…

Subject: Show data in a view column

On the principle that teaching a man to fish and then giving him a fish to tide him over until he catches one is probably the best way to go about solving the hunger problem…

You have a couple of options in formula language to attack the problem. One is old-school, and will work in any version of Notes/Domino. The other is new with Notes and Domino 6. We’ll do the old-school version first, since working list-wise can get an awful lot done with a very little code once you’ve started thinking in lists.

You have a bunch of text values that can be identified by what they end with, and you only want to keep values that have one of the possible endings:

aa@gmail.com

ab1@aa.com

cc@gmail.com

123@g.com

Let’s call that list FieldName for the time being (since that’s where it’s coming from, and it’s easy to substitute the actual field name into the formula later). You are only interested in the Gmail addresses. If you do this:

tempList := @Leftback(FieldName; “@gmail.com”);

you’ll wind up with a list containing these values:

“aa”

“”

“cc”

“”

Note that you need to check for the whole string “@gmail.com”, otherwise addresses ending in something like “@kingmail.com”, which also ends in “gmail.com”, would also be selected. You then trim the list – that is, remove any values that are the empty string:

tempList := @Trim(tempList);

which will leave you with:

“aa”

“cc”

Now, there is a chance that NO Gmail addresses were in the original list, so the whole value of the list at this point may be “” (which is what @Trim will return if there’s nothing else to return). That means that you have to check the list for empty. If it is NOT empty, then adding “@gmail.com” to the list will add @gmail.com to every member of the list.

@If(tempList = “”; “”; tempList + “@gmail.com”)

You can put the first two steps together, giving you:

tempList := @Trim(@Leftback(FieldName; “@gmail.com”));

@if(tempList = “”; “”; tempList + “@gmail.com”)

That will give you a list containing:

aa@gmail.com

cc@gmail.com

That’s the old method. As of Notes and Domino 6, you have the @Tranform function at your disposal, which will allow you to do some more sophisticated kinds of filtering. Again, we’ll use FieldName as the name of the source.

@Transform(FieldName; “x”; @If(@Ends(x; “@gmail.com”); x; @Nothing))

The “x” is the name of the temporary variable that @Transform is going to use for each member of the list. If the member ends with “@gmail.com”, it is kept; if it doesn’t, then it is replaced with @nothing, which is no value AND doesn’t add a member – not even an empty member – to the new list. To make that just a little bit “safer” (that is, to keep your users from seeing any scary error messages in the view column), you would write that formula as:

tempList := @Transform(FieldName; “x”; @If(@Ends(x; “@gmail.com”); x; @Nothing));

@If(@IsError(tempList) | tempList = “”; “”; tempList)

Subject: RE: Show data in a view column

On the principle that teaching a man to fish and then>giving him a fish to tide him over until he catches one

is probably the best way to go about solving the hunger

problem…

What about the case of the man who have been told to take a fishing wessel and go out on the Pacific to fish, despite him never seen a fish before in his life, never been on a boat or an ocean and having no idea about navigation, how to use a depth finder, GPS, radio or even the controls for the ship?

Should we teach him how to fish, or should we ask him to first learn all the basics needed, like how the fishing wessel works, basics on navigation, etc, before we teach him how to catch a particular kind of fish, e.g. tuna?

Just a philosophical question…

Subject: RE: Show data in a view column

Karl, get out of it and dismount from the high horse. You know as well as anyone that “Notes developer” is as often as not a secondary duty, an afterthought, an accident of employment, and that IBM (and Lotus and Iris before that) has consistently positioned the product as a power-users’ tool as much as (or more than) as a “serious application platform”. Yes, we all know that you want to impose legally-mandated “programmers’ licenses” on the world, but that ain’t gonna happen any time soon. So give it a freaking rest.