2 Replies Latest reply on Jul 8, 2013 9:46 AM by philmodjunk

    How to setup match fields to pull data from portals???

    productionQC

      Title

      How to setup match fields to pull data from portals???

      Post

           Hi -

           I would like to refer back to my initial problem of wanting to use data from a one line portal; see Extracting Data From One Line Portals...  I have tried execut sql to no avail....I was wondering if someone could elaborate on this procedure as quoted from the link above - "One method is to set up the necessary match fields to match values at the relationship level to reproduce the set of records being totaled in your filtered portal.".  This sounds like my last viable option, so if you could help me on this that would be great...thanks

        • 1. Re: How to setup match fields to pull data from portals???
          schamblee

               I don't know that you need a portal to do this.  Summary fields also compute based on the current found set.  If you use a find to filter your data down then your summary field will still be correct, then use this summary field in a calculation, which will also change based on your current found set.

          • 2. Re: How to setup match fields to pull data from portals???
            philmodjunk

                 ExecuteSQL will do the job if you have FileMaker 12 and then set it up correctly.

                 "One method is to set up the necessary match fields to match values at the relationship level to reproduce the set of records being totaled in your filtered portal."

                 Means that you will need to either change your existing relationship or create a new table occurrence that refers to your portal's table for use with a new relationship.

                 Say you have this relationship:

                 Parent::PrimaryKey = Child::ForeignKey

                 And you need to match to all Child records whereChild::Type = "Apple".

                 The following relationship would achieve that result:

                 Parent::PrimaryKey = Child|Apple::ForeignKey AND
                 Parent::constApple = Child|Apple::Type

                 constApple would be a calculation field with text selected as the result type and would have this exact expression:

                 "Apple"

                 SO that every record in Parent has the value "Apple" in the constApple field.

                 Child|Apple is the name of a new Tutorial: What are Table Occurrences? for the Child table so that the original relationship is left unmodified for use elsewhwere in your database.