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:
- fetch all 3 fields based on certain criteria,
- combine them together into a single list,
- lowercase everything, then
- remove empty elements.
... all while using the least number of loops etc. (tight code).
All I've come up with thus far is:
- fet = Form[Criteria];
- emails = fet.Email_1.getall();
- emails.addAll(fet.Email_2.getall());
- emails.addAll(fet.Email_3.getall());
- info emails;
- // 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
-
-
-
-
-
-
-
-
-
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
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.