7 Replies Latest reply on Aug 5, 2016 11:36 PM by Johan Hedman

    Fill a field with data from a different table

    mel617

      I am trying to set a field in one table to pull information from another table.  I can get it to pull the initial data when a record is created but how do I make the field change if the original data from changes to change in the other table? 

        • 1. Re: Fill a field with data from a different table
          Johan Hedman

          You need relationship for that to work. Fields that match on both sides on a relationship in your relationship graph

           

          After you have that you can create field calculation to pull data out of the other table.

          • 2. Re: Fill a field with data from a different table
            SteveMartino

            I think I get what you are trying to say, but can you use some real world examples.

            Are you saying (guessing)

            If you update the data from the original table, how do you get it to change on the other table?

            If so, then the question is:

            How did you get the data to 'pull' as you say from the initial table?  Calculation? Lookup?

            If calculation, is it an auto-enter calculation, with the "Do not replace.." box checked/unchecked"

            • 3. Re: Fill a field with data from a different table
              Johan Hedman

              First off use Calculation instead of Lookup because you can handle it much easier.

              The Do not replace should only be enabled if you just want the calculation to take place the first time and never calculated the calculation again. It´s very rare that you setup a field like that if, because if you update things in your related table you would like to have the latest value in your table.

               

              I got Customer and Order

              In Order I have Customer ID that I set when I choosing what customer I want to set for the Order. That means I now can have a relationship between Order and Customer on my Customer ID field.

              I then have three fields for Address, Zipcode and City that I pull out of Customer table instead of having to reenter the information. For that I use a calculated Text field and just choose the related field in the Customer table. If Order need to change Address it can, but it will always start with same address information as Customer have.

              • 4. Re: Fill a field with data from a different table
                mel617

                You are correct in your guess above thank you for making more clear.

                • 5. Re: Fill a field with data from a different table
                  SteveMartino

                  Np, but you didn't answer any of my questions

                  • 6. Re: Fill a field with data from a different table
                    mel617

                    sorry thought it pasted in my answer. See below

                     

                    How did you get the data to 'pull' as you say from the initial table?  I used Calculation.

                    If calculation, is it an auto-enter calculation, with the "Do not replace.." box checked/unchecked" Unchecked.

                    • 7. Re: Fill a field with data from a different table
                      Johan Hedman

                      First of you need to have a relationship to the other table.

                       

                           Then in Manage > Database > Fields

                                     Create a new Field called Test

                                              Field show be out of type Text and hit Create

                                              Click on Options

                                              Click on Calculate value

                                              From value list in upper left corner choose your relationship and pick the field you like to choose so that it end up in the calculation area.

                                               Click on OK

                       

                      Then it is up to you to decide if you want to have the information calculated everytime or just the first time. That is what you do with Do not replace. Like in Order Customer that I wrote about above I have it Enabled because I want the address to be like it is right now and then never change again.

                       

                      You can read about this and a whole lot more in free FileMaker Training Series

                      FileMaker Training Series | FileMaker