Fetching multiple fields to create a neat and orderly list (formatted and not empty)

Fetching multiple fields to create a neat and orderly list (formatted and not empty)

I have 3 email address fields in a form: Email_1, Email_2, and Email_3.

I'd like to:
  1. fetch all 3 fields based on certain criteria,
  2. combine them together into a single list,
  3. lowercase everything, then
  4. remove empty elements.
... all while using the least number of loops etc. (tight code).

All I've come up with thus far is:
  1. fet = Form[Criteria];
  2. emails = fet.Email_1.getall();
  3. emails.addAll(fet.Email_2.getall());
  4. emails.addAll(fet.Email_3.getall());
  5. info emails;
  6. // but if any of the Email fields are empty, I get unwanted commas.
I know at this point I could run a loop to add each email to a NEW list while simultaneously ignoring empty values (.length() = 0) and lowercasing anything else, but that seems inelegant, and my gut tells me I'll want to learn how to do this in the most elegant way.

Any thoughts from the community?
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方