3 Replies Latest reply on Aug 19, 2016 8:07 PM by kabetz

    autofill a table from another table using some of the data

    kabetz

      I have a table that contains a url with a tail eg: www.domain.com/tail what I wish to do is get filemaker to go through the tails and turn them into the domain only eg: www.domain.com having done that I want to automatically seed a new table that contains only the domain name and the new table will not accept duplicates eg www.domain.com could only be added once. Is that possible? Thanks al.

        • 1. Re: autofill a table from another table using some of the data
          DavidJondreau

          Yes this is possible. You'll need to understand calculations for pull out the domain name, the limits of your data (will you get http:// sometimes? what about bad URLs like www.domain? etc), as well as scripting to create a related record in the new table, plus field validation to prevent duplicates.

           

          What real world problem are your trying to solve?

          • 2. Re: autofill a table from another table using some of the data
            philmodjunk

            And one simple way to avoid duplicate would be to define a text field, (can be a global) for the parsed domain name and use it as a match field with the "create" option to your table of domains.

            Once you've parsed the domain from the larger URL, you set the global field to this value and then use set field to set some date to a field in the domain table. The relationship's create option will create a new record, but only when there is no matching record already present in the table and thus you get one record for each unique domain.

            • 3. Re: autofill a table from another table using some of the data
              kabetz

              I have a table which I load a csv file of tails too. The csv file will include multiple tails that all have the same domain name. The csv file is saved in the tails table.

               

              http://www.domain1.com/image/image1.jpg

              http://www.domain1.com/pages/page1.html

              http://www.domain2.com/about/aboutus.html

              http://www.domain2.com

              and so on for the csv file upload to the tails table.

               

              I want to keep the original data in the tails table.

               

              Once the data is uploaded to the tails table I want a script to go through the new upload and identify unique domain names. From the above example it would id http://www.domain1.com and http://www.domain2.com

               

              The second table is the domain table. The domain table carries 1 unique record of each domain.

               

              The script would look to the domains upload from the csv file and identify 2 unique domains added to the tails table. domain1.com and domain2.com

               

              It strips away the http:// and the tail leaving only the domain name: www.domain1.com

               

              It now looks to the second  table; the domain table and identifies if any of the 2 new domains just uploaded are already present in the domain table. If a domain is already present it does not make an entry. If the domain is not present then it adds to the domain table.

               

              The final outcome is that now I have a domain in the domain table eg:

               

              www.domain1.com and in the tails table still the original data.

               

              I'm hoping that describes the real world example.

               

              Thanks for taking the time to assist me.