1 2 Previous Next 19 Replies Latest reply on May 12, 2014 8:07 AM by philmodjunk

    Create a FileMaker Pro survey

    AbdoulBaldé

      Title

      Create a FileMaker Pro survey

      Post

           Hi, 

           I am creating a FileMaker Pro solution which will serve as a simple 10 questions survey. Before going up and starting to build the solution I am wondering which approach to take since I would like the survey to generate a custom report upon completion. (I will create the Layout for the report).

            

           Could you please advice on a few tips, tools to use? I have only started exploring this option.  Thanks. 

           My Tables: 

      Surveys [SurveyID; SurveyName]

      Questions [SurveyID; Question ID; QuestionType ; QuestionGroup ; Question]

      Users [UserID ; UserName] 

      Answers(the ones from which to choose from) [AnswerID ; QuestionID ; Answer]

      UserAnswers [UserID ; Response ; AnswerID]

        • 1. Re: Create a FileMaker Pro survey
          philmodjunk

               You may have seen this thread already as it describe tables similar to yours: Need aid on generating a report from a survey layout.

               Assuming relationships similar to those in the thread for which I just posted a link, you should be able to create summary reports on a layout based on UserAnswers that includes fields from the other related tables. Summary fields can count the number of responses with a given AnswerID if you put the summary field in a sub summary layout part that is sorted by AnswerID and you can add another sub summary layout part "when sorted by QuestionID" so that the answer statistics are grouped under each question.

               And you can remove the body layout part from such a layout to show only the aggregate answer statistics instead of the individual userAnswer records.

               Here's a tutorial on summary reports: Creating Filemaker Pro summary reports--Tutorial

          • 2. Re: Create a FileMaker Pro survey
            AbdoulBaldé

                 many thanks for the link. It helped me a great deal. I am having difficulty displaying the questions and the possible answers  (radio button format) in a portal while I am based on the Respondents TAble. Could you please advise? Do I have to set up a conditional value list? 

                 Please see a screenshot of my relationships attached.

                  

                 Many thanks. 

                  

            • 3. Re: Create a FileMaker Pro survey
              philmodjunk

                   What are you listing in the portal?

                   On what table are you basing that portal?

                   Yes, a conditional value list is in order to list the possible answers for each record in Questions that you choose to display for a given survey being completed by a given respondent.

              • 4. Re: Create a FileMaker Pro survey
                AbdoulBaldé

                     I wanted to list the PossibleAnswers for each question.

                "With the above structure, you can set up a portal to responses on the respondants layout. The Question field from the related Questions table can be added to this portal so that the respondant can read the question and select a response in the portal for each question."

                     The portal is based on ResponsesTable. Am I way off?

                • 5. Re: Create a FileMaker Pro survey
                  philmodjunk

                       No, you are right on.

                       Do you know how to create the needed conditional value list so that the possible answers appear as a value list for the Responses::ChoiceID field placed in that portal row?

                       If not see the links below. It's a major "Infodump", but you probably only need to look at either the first or second link possibly followed by a look at the demo file in link 3.

                       There's a lot of overlap between the first two links so you can read one and skim the other. The demo file gives you several examples of different conditional value lists so you can examine them to see how they are set up. If you are using FileMaker 12 or later, you can open this demo file from your File menu to get a converted copy of the demo file that you can examine in your version of FileMaker.

                       The next to last link discusses how to set up a chain of conditional value lists where the value selected in each conditional value list controls the values listed in the next value list and the very last link is a fairly new addition that describes how to use ExecuteSQL to produce conditional value lists that aren't easily possible with the other methods described here.

                       Forum Tutorial: Custom Value List?

                       Knowledgebase article: http://help.filemaker.com/app/answers/detail/a_id/5833/kw/conditional%20value%20list

                       Demo File: https://www.dropbox.com/s/j6qf0z9fnem3uxd/ConditionalValueListDemo.fp7

                       Hierarchical Conditional Value lists: Conditional Value List Question

                       Using ExecuteSQL to produce a conditional value list: Using ExecuteSQL to Produce a Conditional Value List

                       Feel free to post follow up questions here if those links aren't enough to get your value lists working correctly.

                  • 6. Re: Create a FileMaker Pro survey
                    AbdoulBaldé

                         Thanks for the links. I was able to display the possible answers for each question however I was only able to do it on The QuestionsTable based layout. When trying to display questions and their set of choices (possible answers for that question), nothing appears on the Layout. I know I have to slightly change my structure or use a script. Could you please advice? 

                         How can a selected possibleanswer be captured and associated to the survey and the respondent?

                         Thanks. 

                          

                    • 7. Re: Create a FileMaker Pro survey
                      AbdoulBaldé

                           I came across a thread on the forum discussing about global fields for the QuestionsTxt field. Do you think it is the reason why I can't seem to be able to display the questions and their related set of possible answers while on the layout based on the Respondent Table?

                            

                           Thanks. 

                      • 8. Re: Create a FileMaker Pro survey
                        philmodjunk

                             There are several options for how to set this up. The following option does not use global fields:

                             First, we have: "a portal to responses on the respondents layout."

                             So each portal row in this portal represents one respondent's answer to one question. In this portal row, the ChoiceID field can be set up with a conditional value list of values from PossibleAnswers. The value list would use the specify values from a field option and list values from PossibleAnswers::__pk_ChoiceID as "field1" and ChoiceText as "field 2." You'd select the "Include only related values" option and specify Questions as the "starting from" table occurrence.

                             But a missing detail is that you need to create a record in responses for each question for each respondent. Until you have a record for each question for that respondent, you can't list questions in your portal to responses. This can be set up with a script that loops through the records in questions and produces one record in responses for each question with the respondent's _pk_ RespondentID value entered into the RespondentID field and each Question record's _pk_QuestionID value entered into the QuestionID field of each such new record created.

                             This then makes it possible to put the QuestionText field from Questions in the row of this portal to show the questions for the selected survey.

                        • 9. Re: Create a FileMaker Pro survey
                          AbdoulBaldé

                               Thanks. I think the script is described in the link you provided. Regarding 

                               "First, we have: "a portal to responses on the respondents layout."

                               So each portal row in this portal represents one respondent's answer to one question. In this portal row, the ChoiceID field can be set up with a conditional value list of values from PossibleAnswers. The value list would use the specify values from a field option and list values from PossibleAnswers::__pk_ChoiceID as "field1" and ChoiceText as "field 2." You'd select the "Include only related values" option and specify Questions as the "starting from" table occurrence."

                               I tried but the PossibleAnswers do not show. (No values defined) Please see screenshot. Could you please advise me? 

                                

                          "But a missing detail is that you need to create a record in responses for each question for each respondent. Until you have a record for each question for that respondent, you can't list questions in your portal to responses. This can be set up with a script that loops through the records in questions and produces one record in responses for each question with the respondent's _pk_ RespondentID value entered into the RespondentID field and each Question record's _pk_QuestionID value entered into the QuestionID field of each such new record created.

                               This then makes it possible to put the QuestionText field from Questions in the row of this portal to show the questions for the selected survey."

                          About that part, when would the script be run? Is the script run when user selects a possible answer? (using script triggers OnObjectModify)

                                
                          • 10. Re: Create a FileMaker Pro survey
                            philmodjunk

                                 The script must be run before the respondent can even see questions to answer. Thus you need to run this script at some point on or before the respondent actually sits down to read questions and select answers.

                                 Until you run this script, the rest of this will not work as there is no record in the table to make the needed valid link to PossibleAnswers and you won't see any values in your portal row. Nor will you see any questions in the portal row either.

                            • 11. Re: Create a FileMaker Pro survey
                              AbdoulBaldé

                                   Hi, 

                                    

                                   I have created the following script but I am still unable to display both questions and possible answers on the Respondents layout. Please see screenshot for both the script and my relationships. I have created a Home layout with a start survey button [Go to Layout (Respondents Laypout + Perform The script "Survey"]. Could you please help?

                              • 12. Re: Create a FileMaker Pro survey
                                AbdoulBaldé
                                /files/9bda1a8e80/Screen_Shot_2014-05-09_at_7.57.09_AM.png 1127x740
                                • 13. Re: Create a FileMaker Pro survey
                                  philmodjunk

                                       The script is basically correct except for one possible detail: Does this script start from a layout based on Respondants and did you create a new record just before running this script. Since you need a different record for each respondant, you need to be sure that you are on the correct record before this script is performed or the variable for the respondantID won't get the correct value.

                                       Assuming that you do run this script from a layout based on Respondants and that you have the correct current record at the time that you run it, there are several key details that could keep this from working.

                                       Your layout must be based on Respondants with a portal to Responses.

                                       The Questions::Questiontxt field should then be placed in the portal row to show the actual question to be asked.

                                       Let me know if you can get to that point or not and then we can take a closer look at how to display the possible responses correctly.

                                  • 14. Re: Create a FileMaker Pro survey
                                    AbdoulBaldé

                                         Thanks for your reply. I have added the following steps to the script:

                                         Go To Layout [The one based on respondants]

                                         New Record

                                          

                                         I am now able to see the first question in the portal but not the set of PossibleAnswers for that specific question. Also, how would the user go the next question since the Layout is based on respondents, a go to next record will not work. I was thinking about adding a button which will perform a Go to portal (next) ? 

                                         Could you help me with "how to display the possible responses correctly."?

                                          

                                    Thanks.

                                    1 2 Previous Next