3 Replies Latest reply on Oct 21, 2011 10:02 AM by philmodjunk

    Survey Skip Logic

    JoshWheeling

      Title

      Survey Skip Logic

      Post

      Hi,

      I am creating a form for surveyors to use to enter data on mobile devices, and want to make it as straight-forward as possible. I am new to Filemaker, and have only done simple scripts on the tutorial, etc. Is there an easy way to make a script so that If the answer to Question 2 is "yes", the form displays Question 3, and if the answer is "no", it skips from Question 2 to Question 5. Is that simple to do? Is there a place I can read about how to do this? It would be nice to have Questions hidden if skipping around them, so surveyors aren't confused, or at least put different branches in different layout tabs, and have a script link to those.

      Thanks!

      Josh Wheeling

        • 1. Re: Survey Skip Logic
          philmodjunk

          Use the "search the forum" box to reseach "survey" here in this forum. There are a number of good threads where the structure of a survey database is discussed and a good structure is critical to avoiding major snafus when working with your survey--both in recording the data and in analyzing the responses.

          If each Question is a separate record, you can give each such record a unique serial number to identify it. You can then add fields in this record or a related table that store the ID number of the next question based on the response recorded. (with a related table, you can have a flexible number of possible responses rather than just Yes, No or a specified maximum number of possible responses.)

          Then your script can use the response given to determine the ID number of the next question to be presented and can the use that ID number in a Find to pull up the next question record.

          Use one of the following two steps to get the ID # of the next question:

          Set Variable [$NextQ ; If ( Responses::Response = "yes ; Question::NextQIDonYes ; Question::NextQIDonNo]
          Set Variable [$NextQ ; NextQuestion::QID //NextQuestion is a related table and the relationship uses the response value to match to a record with the ID of the next Question]

          Then the rest of the script might look like this:

          Enter Find Mode [] //clear the pause check box
          Set field [Question::QID ; $NextQ]
          Perform Find []

          This assumes your layout is based on Question and that you have valid relationships linking the current record to a Responses record and (in the case of the second Set variable example) then it links to a related NextQuestion record.

          • 2. Re: Survey Skip Logic
            JoshWheeling

            Great, I really appreciate the quick response, this looks very helpful. I am not too familar yet with creating or imputting code for scripts, but I will research more on this. The ID number makes sense, I take it FMP can hide branched survey questions until they are reached? I will look at previous threads as well.

            If I have further questions, which I'm sure I will, should I just reply to this thread?

            Thanks!

            Josh

            • 3. Re: Survey Skip Logic
              philmodjunk

              I take it FMP can hide branched survey questions until they are reached?

              In Form view you can only see one record at a time so that is part of what is "hiding" the other questions. Also, the find performed will pull up a found set of just that one next question record and this further hides the other question records unless the user performs a find or uses one of the other options in the records menu to modify the current found set as the "book" control can no longer be used to change to a different record in the found set.