2 Replies Latest reply on Apr 26, 2013 2:56 PM by BrentPowers

    Import Questions with same Survey ID



      Import Questions with same Survey ID


           Hey All

           I am new to the forums and I have learned tons since I started with FM a week and a half ago.  Thanks for all the information on this forum.  Unfortunately, I am still utterly green.  I was hoping that y'all could help me.


           I am creating a database for surveys that have simple answers (Yes, No, Maybe).  In the end I want to create a report with the answer tallies that I can use to create charts/graphs.  I figure you can see everything in the screenshot.

           To get the survey questions into the survey I was importing the records through a script triggered by a "new survey" button.  Each question is imported into its own record, but they each have a unique Survey ID.  I want them to have the same Survey ID and be able to view them on the same Survey layout.  Is this possible?

           Thanks in advance for your time!


        • 1. Re: Import Questions with same Survey ID

               First, there's something not quite right in your relaitonships. The above screen shot shows that you have a one to one relationship between questions and Responses. There should be "crowsfeet" on the Responses end of the relationship line. Either you have a unique values validation option or an auto-entered serial number setting on fk_Question ID that should be removed.

               If you are using import records, to create a new set of responses records that match to each record in questions, immediately after the import, the newly added records will make up a found set of just those records, you can then use Replace Field Contents to update the fk_survey ID field with the correct value. your script might look like this:

               Go to layout [Survey]
               new record/request
               Set variable [$SurveyID ; value: Survey::pk_SurveyID]
               Go To Layout [Questions]
               Show All Records
               Go to Layout [Responses]
               Import Records [//import questions into responses here]
               Replace Field Contents [ Responses::fk_Survey ID ; $SurveyID ]

          • 2. Re: Import Questions with same Survey ID

                 Thanks Phil!