2 Replies Latest reply on Apr 22, 2014 7:44 PM by samjs

    Go to Related Unique Records

    samjs

      I have created a Student Database that tracks information on students and their parents. I want to send an email to the parents using "Go to Related" records from the Student table to the Parents table. Because there are siblings in the student table, thus creating "mom and dad" twice in the Parents table, it shows me the mom and dad twice in the parents table when using this script. I only want to send each parent the email once.

       

      I have figured out how to create a field that flags each parent as unique using "1" so I'm set there. My problem now is going to the related records and only showing each parent once.

       

      What is the best way to omit duplicate parents once I have used the "Go to Related Records" script?

       

      Thanks for your help!

        • 1. Re: Go to Related Unique Records
          Mike_Mitchell

          Sam -

           

          One way to accomplish this would be to loop over the records from top to bottom. Test a variable for the presence of each record's primary key using FilterValues ( ). If the key is present, omit the record and move on. If not, add it to the variable in a return-delimited list using List ( ) and go to the next record.

           

          If you're using version 13, you can make use of the new List Of summary field type to assemble the list of keys quickly. This would give you a quick indicator of duplicates, as you can use ValueCount to find out how many occurrences of the current primary key exist in the found set.

           

          HTH

           

          Mike

          • 2. Re: Go to Related Unique Records
            samjs

            Mike,

            That worked perfectly!  Thanks for the help!

             

            Sam