5 Replies Latest reply on Mar 1, 2011 3:04 PM by philmodjunk

    problem with merge field

    LiemDo

      Title

      problem with merge field

      Post

      Hi,

      I'm trying to export all the answers of my questionnaire using merge  fields. The problem is Filemaker shows only the first row of the  records. For example, if I type:

      <<name>>

      I'll get the name of the first person in the database only:

      Joe Bush

      I'd like to get all other names too:

      Joe Bush
      Michell Wang
      ...


      The Portal tool can help but its rows have fixed height while I want to  export questions, answers, name, etc from the database. Some questions  are long and cannot fit on one line.

      Will Scripting help in this case? Thanks

        • 1. Re: problem with merge field
          philmodjunk

          I'm trying to export all the answers of my questionnaire

          What export method are you using? The way you design a layout has little to do with how the data is exported, unless you are either printing the data or using save as PDF...

          There's nothing in your post that makes a good case for using merge fields here.

          if I type: <<name>> I'll get the name of the first person in the database only:

          But where did you type it?

          If you put this in the body, you should get every name in your current found set. Only if the current found set consists of just one record will you get just the one name.

          Some questions are long and cannot fit on one line.

          Outside of a portal, you can use Slide up | also resize enclosing part --options found on the position tab of the inspector, but only for printing and saving as PDF--not for data export.

          • 2. Re: problem with merge field
            LiemDo

            Hi,

            I plan to print it as PDFs.

            I'm sorry that I gave a bad example. Each person has mutiple questions. I'd like to create a report page for each person that displays all of their answers. I used Text Tool to create a text field and insert merge fields:

            <<name>>

            <<id>. <<questions>>

            <<answers>>


            Suppose that Michell Wang has 2 questions. I expect to see this in Browse Mode:

            Michell Wang

            1. First Question

            Answers 1

            2. Second Question

            Answer 2

            However, what I get in Browse Mode is:

            Michell Wang

            1. First Question

            Answer 1


            I don't want to use a portal as I need my report to be displayed like above (vertically). Thanks

            • 3. Re: problem with merge field
              philmodjunk

              As far as I can tell, you don't need merge fields.

              How is your data structured? Is each question and answer in a separate record? Is the name in a record from a related table? If you have two tables for this, on which is the layout based in Layout Setup...?

              Assuming separate records for each question and corresponding answer, you can set up a list view layout like this:

              Sub Summary when sorted by Name------
              Name Field

              Body-----------
              QuestionID  Field    Question Field
              Answer Field

              In browse mode, you will need to specifically sort the records by the Name field. There's no need to make any of these fields merge fields.

              This will produce a report that looks like:

              Michell Wang
              1. First Question
              Answers 1

              2. Second Question
              Answer 2

              You can make the question field 2 or more lines of text tall and set all the fields in the body to "Slide up, also resize enclosing part".

              Key facts about sliding:

              1. It's only visible in preview mode and when you print/save as PDF...
              2. All layout objects below a slide/resize field need to also be set to slide up and resize.
              3. Only objects in the body will slide.
              4. Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
              5. Consistent side borders are difficult to achieve with sliding fields.

              • 4. Re: problem with merge field
                LiemDo

                Hi,

                I have 3 tables: user, question and answer. They are related by the field ID.

                I tried to use the Portal but the problem is the fields within the portal row don't shrink as you mentioned. And all the rows of the portal have the same height.

                Do you think if we can write a script to perform a find and insert questions and answers into a text field? My problem will be solved if we can do that. Thanks

                • 5. Re: problem with merge field
                  philmodjunk

                  I haven't suggested using a portal. Use a list view layout based on either question or answer. (Select this in Show Records From in Layout Setup...)

                  Place the question and answer fields in the body of the layout. Place the name field in the sub summary part when sorted by name or you can use "when sorted by ID".

                  Sort your records by the same field that you specify as "when sorted by" in the sub summary part and you'll get the result you want. Since this doesn't use a portal, you can set the question and answer fields to slide up and resize the enclosing part.