How do I combine several fields into one field arranging the data alphabetically?

Posted on 2005-04-26
Last Modified: 2013-12-18
Good morning everyone. I have created a form in Lotus Domino Designer that has several fields I would like to combine into one field during Opened for Reading Mode. In Edit Mode the fields look like this:

Field 1 = Clear Beans
Field 2 = Blue Beans
Field 3 = Green Beans
Field 4 = Select another brand...
Field 5 = Select another brand...

As you can see the user can select however many brands are carried at a particular store. I would like to combine the data into one field in alphabetical order when the form is in Opned for Reading Mode, excluding any "Select another brand..." choices.

Field 6 = Blue Beans, Clear Beans, Green Beans

How can I do this?
Question by:GCortesJr
    LVL 9

    Expert Comment

    Make field 6 a computed field (or use the Computed Text option).

    For the value of the field, put this formula:

    myList := Field1:Field2:Field3:Field4:Field5;
    myTrimmedList := @Trim(@Replace(myList; "Select another brand..."; ""));
    @Sort(myTrimmedList; [ASCENDING]);

    I'm assuming you're using R6, otherwise the @Sort formula will generate an error.  The first line builds a list based on the values of your 5 fields.  The 2nd line uses the @Replace function to turn any "Select another brand" values of that list into "" empty strings.  The @Trim function then removes any empty string list items from the list and essentially leaves you with just the values "Clear Beans", "Blue Beans", "Green Beans".  Finally @Sort takes everything and sorts in ascending order.

    BTW, what are Blue Beans anyway?  Sounds like Green eggs and ham.
    LVL 9

    Expert Comment

    Forgot to add that this question should be posted in the Lotus Notes/Domino formum, not the Lotus Smart Suite forum.

    Author Comment

    LOL, they are just died beans. Nothing special.  have to make a slight change to my request. The fields that I am getting data from to combine have been changed to Checkbox fields. So when I put in just the first line of your formula, I just get a zero back. What am I doing wrong?
    LVL 9

    Expert Comment

    What are the values of the checkbox fields?  In the 2nd tab of the field properties you can specify what the value(s) of the fields are.  Sometimes they are just one word or phrase, which is what the field gets set to when it is checked.  Other times it'll look like this:  "Blue Beans | 1", which means that Blue Beans displays in the client and "1" gets stored as the value of the field.

    Author Comment

    The value is just one word/phrase per field
    LVL 9

    Accepted Solution

    Hmm...I just reread your 2nd posting.  Did you say you only put in the 1st line of the code?  That first line won't return anything.  It's simply an assigment.  You'd need to put this to test the first line (the 2nd myList returns the list):

    myList := Field1:Field2:Field3:Field4:Field5; myList;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now