Get prefix of field, get distinct list, insert list as new records in new form

Get prefix of field, get distinct list, insert list as new records in new form

I'm trying to get fetch records in a form, get the first section of data from one of the text fields (everything before a "-"), then filter out duplicates, then use that list to make new entries in a new form. Here's what I think it should look like but it doesn't work:
  1. void insertUniqueList()
  2. {
  3. var = form1[ID !=0].textField1.getPrefix("-").getAll().distinct();
  4. for each index uniqueValue in var
  5.         {
  6. x = insert into newForm
  7.         [
  8.         newField = uniqueValue
  9.         ];
  10.     }
  11. }

    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 コンテンツ




                              ご検討中の方