Proposing a new function for lists: Remove Duplicates

Proposing a new function for lists: Remove Duplicates

Currently I use a cumbersome way to create a list and then feed unique values to another list all for the purpose of removing duplicates. The USER_IDS is an integer list of record IDs. Because of the way my database is constructed, if the criteria is met, this list can have duplicates. To remove them, I have to feed the list of IDs to another list (UNIQUE_IDS) as long as the ID is not already there.

  1. USER_IDS = (DATABASE[(USER_DATA.contains(r.SUBLIST) && STATUS == "CONF")].ID).getall();
  2.     for each n in USER_IDS
  3.     {
  4.         if(!UNIQUE_IDS.contains(n))
  5.         {
  6.             UNIQUE_IDS.add(n);
  7.         }
  8.     }

What I am proposing is a simple function that takes a list, and removes all duplicates:

  1. USER_IDS = (DATABASE[(USER_DATA.contains(r.SUBLIST) && STATUS == "CONF")].ID).getall();
  2. USER_IDS.removedups();
It should work for both string and integer lists.

John M. Whitney
    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 コンテンツ




                              ご検討中の方