4 Replies Latest reply on Jan 26, 2015 10:39 PM by erolst

    Filemaker 11 Question on extracting portal information to an email

    loz

      Filemaker 11 Question: I would like to send an email capturing information from a portal but it is only capturing the first line item and not all the list of job items. Is there something I should be putting in the calculation for it to pick up all?

        • 1. Re: Filemaker 11 Question on extracting portal information to an email
          erolst

          loz wrote:

           

          Filemaker 11 Question: I would like to send an email capturing information from a portal but it is only capturing the first line item and not all the list of job items. Is there something I should be putting in the calculation for it to pick up all?

           

          Generic answer: use List() to get a list of list of job items; if necessary, transform the resulting list into a line by using e.g.

           

          Substitute ( List ( Jobs::items ) ; ¶ ; ", " )

           

          This assumes that your portal isn't filtered.

           

          If you need a more specific answer, provide more detail.

          • 2. Re: Filemaker 11 Question on extracting portal information to an email
            loz

            Wonderful thank you

             

            I have never used the e.g. function before so not quite sure how to format it

             

            Wondering how you write it to list the following items (these are my field names):

            :: WIP 3 Job Details

            :: Job Bag Status

            :: Requestor

            :: Designer

            :: startDate

            :: endDate

             

            I am only a beginner so this is all new and exciting! thank you for your help

            • 3. Re: Filemaker 11 Question on extracting portal information to an email
              loz

              So it looks like this in the email going out

               

              Details for project P2921 Test Project Annual Reports <this comes from the Project file>

               

              <Below comes from the portal in the project file>

               

              JB32696 (653637 Test Project 1) 0615 Start date: 27/01/2015 End date: 27/01/2015

              Status: Await copy Requestor: Joe Blogs

              JB32697 (653638 Test Project 2) 0615 Start date: 27/02/2015 End date: 27/03/2015

              Status: Await copy Requestor: Jane Doe

              • 4. Re: Filemaker 11 Question on extracting portal information to an email
                erolst

                So you have multiple records with multiple fields … there are basically two approaches:

                 

                1. In the portal table, create a calculation field that concatenates the fields in question to desired result (e.g.

                 

                Let (

                  myList = List (

                    jobNo ;

                    Case ( not IsEmpty ( ProjectName ) ; "(" & ProjectName & ")" ) ; // use same check for other fields

                    "Start date: " & dateStart ;

                    "End date: " & dateEnd ;

                    "Status: " & Job Bag Status ;

                    "Requestor: " & Requestor

                  ) ;

                  Substitute ( myList ; ¶ ; " " )

                )

                 

                then List() that field.

                 

                Not sure which of your fields generated which part of the sample content, but you get the drift. If not, study text functions …

                 

                2. In your Send Mail script, add a section like the following to compile a list of job lines by looping through the portal rows:

                 

                # on the portal layout

                If [ not isEmpty ( PortalTO::primaryKey ) // i.e., has related records ]

                  Go to Object [ "portalName" ]

                  Go to Portal Row [ first ]

                  Loop

                    Set Variable [ $currentLine ; calculation from above, now using the related version of the fields (i.e. PortalTO::jobNo etc.) ]

                    Set Variable [ $jobList ; List ( $jobList ; $currentLine ) ]

                    Go to Portal Row [ next ; exit after last ]

                  End Loop

                End If

                # reference $jobList in Send Mail step

                 

                Saves you an otherwise unnecessary calculation field.

                loz wrote:

                this is all new and exciting!

                Isn't it just!