1 Reply Latest reply on Jul 6, 2010 9:18 AM by philmodjunk

    Compare two lists and remove those that match. How do I do this?

    DavidKlein

      Title

      Compare two lists and remove those that match. How do I do this?

      Post

      Hi, I am an advanced beginner on FMP for Mac.

      I have a list of e-mail addresses, about 10,000.

      We can call this list A.

      Then I will be getting a list of those e-mails that unsubscribed.

      We can call this list B.

      I will want to remove all of the e-mails that show up in list B, that

      I can find in List A so we don't mail them again.

      There are e-mails in List B, that will not be found anywhere in list A.

      How can I do this as simply as possible in FMP for Mac.

      There will be too many of these to go through manually, so it will need some type of automatic function.

      Thank you soooo much!

      dk

        • 1. Re: Compare two lists and remove those that match. How do I do this?
          philmodjunk

          You can do this fairly easily with a relationship and the Go To Related Records script step.

          In what format do you get your two "lists"? Presumably "list A" is a filemaker table. In what form will you receive "List B"? If you can get List B into a value list (a list of emails in one field separated by returns) you can set up the following relationship and script to do what you need:

          Define gUnsubscribeEmails as a global text field in "table 1".
          Define a relationship using this global field: Table 1::gUnsubscribe = List A::EmailAddress
          "Table 1" and "List A" can be different table occurrences of the same data source table.

          Write a Script and run it from Table 1:

          Go To Related Records [show only related records; from table: "List A"; Using Layout: "List A" ( List A )]
          If [ Get ( LastError ) ≠ 0 ]
             Show Custom Dialog ["No unsubscribe records were found..."]
          Else
             //Do what you need to unsubscribe the List A records you have found to unsubscribe
          End If

          PS. a variation of this method can be used if List B is an email list that you import into separate records.