List Aliases

Most learned experts,

I have a quandry about aliases. I have a field that contains a selection with their aliases.

Full name1 | alias1
Full name2 | alias2

I need to get back to the full name of the selection and not the alias as I need to do a check on the full name within the form. I looked at a question that was answered by CRAK but am still very confused.

BTW - I am on R5.0.12. Thank you.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The field allows you to "view" full name1, but stores alias1  in the field.

If you were to view the forms in a view column, you would see alias1 and then have to transpose them back to the fullname,

i.e. @if(fieldname="alias1";"Full Name1"l fieldname="alias2"; "Full Name2"..and so on.

Your "recovery" might be the same in an agent, if you wanted to create another field, "showalias"

I tend to put both values in a computed field at the top of the form(theList)
"Full Name1|alias1":"Full Name2|alias2":"and so on"

This way I can always cycle through them to show either the alias or the string value.

Does this help?
ZvonkoSystems architectCommented:
Is this question for Browser or Notes client?
I'm not sure which question/answer you are refering to, but I'll give you an example of what I'm currently using:

A multi value computed for display field, collects a set of choises from a view. These choises can be defined by content managers in the database.
Assume the field is called "checkbox_choises". Its formula could be a @DbLookup or a @DbColumn:
@DbColumn("":"NoCache"; @DbName; "<viewname>"; 1)
This may raise a list like "Choise 1|Ch1":"Choise 2|Ch2":"Choise 3|Ch3"
You may also feed it with that exact list for evaluation of this example.

A 2nd field is (in my case) a checkbox field (editable), called "checkbox".
Its choises are retrieved directly from checkbox_choises. You'll notice it'll return the aliasses as expected.

A 3rd field should collect all of checkbox_choises values, that were selected in checkbox.
I called the (multi value, computed) field "checkbox_selected".
It's formula is:

input_lst := checkbox_choises;
select_lst := checkbox;
input_scrambled_selection := @ReplaceSubstring(input_lst; select_lst; "");
input_delete_unscrambled := @Replace(input_lst; input_scrambled_selection; "");

If you selected Choise 1 and Choise 3, checkbox will hold "Ch1":"Ch3".
Checkbox_selected will now hold "Choise 1|Ch1":"Choise 3|Ch3".

Instead of using an @If statement to (again?!) hard-code a list of choises, you can now use the value of checkbox_selected to get hold of the chosen values. Works inside the document and in views!
Try for example:
@Left(checkbox_selected; "|")

OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Sjef BosmanGroupware ConsultantCommented:
Are both "full name" and "alias" stored in documents anywhere? So you can retrieve them and create code to compute the full name from an alias?
notesrookieAuthor Commented:
I am working in a Notes client and within a form. The field is an editable dialog list allowing only a single selection. The selections are included in the field under Enter Choices (one per line). The alias information is used in a bunch of views and I would like not to disturb the scheme of things. The full names and the aliases are only stored in this field. Is there still a way to get the full name instead of the alias within the document

I used CRAK's method, copying his choices into my dialog list field but the last field mentioned still only showed the alias.

Sjef BosmanGroupware ConsultantCommented:
> Is there still a way to get the full name instead of the alias within the document
CRAK's should work, and sjef spoke too soon :)

"Full Name 1|alias1":"Full Name 2|alias 2":"Full Name 3|alias 3"  in a computed, multi-value field at the top of the form.

Then your combo box(etc) formula can reference the field, theList.  Which doesn't change the values in the dialog box or the selected or the views.
Then you add a few more fields to eventually end up with the ALIAS value(s) matching what is selected in the combo/list box.

Also,  check out this, where sjef and I provide several ways to concatenate and cycle through the multi-value, concatenated field.

These are very similar to CRAK's suggestion - if you know one value, then getting to the other is possible as long as they're linked somewhere in a field.

Goes without saying that if you test on a separate database, you will also have to update the existing data forms to reflect the changes.
Sjef BosmanGroupware ConsultantCommented:
I meant to say: No, not dynamically. When hard-coded, everything is possible...
Did you change the fieldnames where the vars "input_lst" and "select_lst" retrieve their values from? I assume you're still using your own dialox list / checkbox / radio button /...

When testing (with the 3rd field visible), you might want to set "refresh fields on keyword change" (in the checkbox field). This shouldn't affect your results though.
notesrookieAuthor Commented:
CRAK - yes I did change the fieldnames. Field #1 contains the fullnames and aliases, is called customer and contains "Choise 1|Ch1": "Choise 2|Ch2": "Choise 3|Ch3". In field#2, chk_customer, it is computed and I have the formula customer. In field #3, customer_selected, computed contains the formula you mentioned.

Formula for field #3:
input_lst := Customer;
select_lst := chk_Customer;
input_scrambled_selection := @ReplaceSubstring(input_lst; select_lst; "");
input_delete_unscrambled := @Replace(input_lst; input_scrambled_selection; "");

When I select Choise 1 in field #1, field #2 and 3 both show Ch 1. I must have gotten something mixed up? Thanks.
Sjef BosmanGroupware ConsultantCommented:
You need:
- one computed field called AllCustomers, multi-value, with
    "Choise 1|Ch1": "Choise 2|Ch2": "Choise 3|Ch3"
- one dialog list field called Customer, with a formula for its choices
- one computed field CustomerName with the formula
    @Replace(Customer; @Right(AllCustomers; "|"); @Left(AllCustomers; "|"))    

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sjef.. so, gotcha twice today, huh?   Glad it's becoming possible...
Sjef BosmanGroupware ConsultantCommented:
I can't stand hard-coded "flexibility"... My "No" still stands, I think.

It would have been better to have the AllCustomers field with a formula like
    @GetProfileField("Settings", "AllCustomers")
or something programmatic.
notesrookieAuthor Commented:
I agree with you, sjef, about the hardcoding. Unfortunately it's an inherited database and where I used to have a mental block about LS, now I find that I have a mental block about profile documents. Not sure why, I think I'm afraid of them and I haven't had the time to read up on them. Got any good sites I can go to to read up on that or should I open a new question about that?

Let me try what you suggested. Thanks.
notesrookieAuthor Commented:
Cool, sjef - Thanks for explaining things to me. I was looking at what CRAk and marilyng were saying but it did not get through to my processing thought center. So I'll split the points with you getting the majority of it. Once again the fog has been lifted. Arigato, kamsahabnida, gracias, merci and dank u.
Sjef BosmanGroupware ConsultantCommented:
Graag gedaan! ;)
"dank u"?!
Hmmm.... sounds familiar! Notesrookie, where are you from?

And did you get my example to work, or do you want me to upload a working example to an FTP server somewhere?
Well, tuttie-frutti -  Crak, you and I do all the hard work and sjef kicks in after he again says , "it can't be done.." to prove us wrong, and gets the points... hrumph! :0)

Just kidding, really..

To answer your question, notesrookie, about profile documents.  They are marvelous if:  they are for user configuration and have user names attached to them, or they are for database configuration and, by that virtue, don't change much..

I always add default values to all my profile documents because, guess what?  The second you call it, it's there, so a if /is nothing check always fails because a profile doc is always something.  I understand some people have had problems with them (database profiles) in replicated databases, but I have not, ever.

Some people try to use them as sequential numbering documents... that's a no-no.. because the profile document caches for the user, and doesn't update until the user exits and reopens notes.
Sjef BosmanGroupware ConsultantCommented:
Profile documents are brilliant solution to "static" memory: configuration settings, session variables, things that need to be saved temporarily without putting them into environment variables cluttering up Notes.ini. On the other hand, profile documents can be a real pain in the butt. When you update a profile document on two different servers, there will be two different profile documents that are NOT replicated: each server is stuck with the same profile document.

I made some functions to deal with this problem, one is to read the profile document in memory, then to delete all existing profile documents, and then create a fresh one from the data stored in memory. Very strange. I later explicitly added the field $ConflictAction with a value of "3", to try to merge profile documents whenever possible. This was necessary because I don't create profile documents using a form.
Marilyn, you're right: it's not fair that {My "No" still stands}-sjef runs off with "our" points! Perhaps I should consult our PE....?!  LOL!
Nah.... I find confort in knowing that we tought TWO people something in a single question! ;-)) How 'bout you?
(just pulling sjef's leg, notesrookie!)
Sjef BosmanGroupware ConsultantCommented:
It's not fair, getting both my legs pulled at the same time! :'( Such fine legs...

I think you two just can't handle it. What a disgrace. But, I'll make a gesture out of my good will and generosity: there's a certain Page Editor (we won't mention his name of course) whom I'll ask to adapt the points as he sees fit, but only if Notesrookie agrees. May I quote Daffy on this? Better not: see

Oh please give the PE a break.... he has just finished editing a question (marilyn, you're welcome) and hopes this should not become a habit. Besides, he remembers a few occasions where one of the experts (often the same for some reason) saw no need to reassign points.
Personally, I feel the same here!
Let's not give notesrookie the wrong impression: nothing wrong with what he dis. And his explanation said it all: Marilyn and I didn't get through to his CPU untill you rephrased it.

Marilyn, the next time we each pull one of sjef's legs, let's tie him down before he crawls up again! ;-))
Agreed... I really wasn't looking for points either in this or the other question. I was amused at the irony of it all: the one who got the points was the one who said it couldn't be done and who went about trying to prove that it couldn't be done only to discover that it could.

The other question had the "it's not possible" response marked as the answer.. which, if you read through the question, saw that there was an answer, along with some nice discoveries.  I just wanted to make sure that people referencing the question didn't dismiss the rest of the solution because of the "accepted answer".
notesrookieAuthor Commented:
sjef, CRAK, marilyng,

Thanks for all your help. I had to award sjef the point because he actually spelled it out for me that it couldn't be done and then he turned it around. A much more difficult feat, don't you think?

But I'm originally from Malaysia and speak several languages, unfortunately Dutch is not one of them. "Dank u: is the only word I know. I now reside in sunny California (except it's been raining lately, a lot!)

I'm sure I will be posting more question in the future and I'm sure that you, CRAK and you, marilyng, will be getting the points instead of sjef. :D

Take care and may the domino be with you (i know ... *groan*)
-Notes Rookie
We all appreciate when someone restates what others have said in a way that makes a bit more sense.   The important thing is that you got the help you needed.
I second that!
Sjef BosmanGroupware ConsultantCommented:
I third!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.