2 Replies Latest reply on Dec 16, 2014 7:46 AM by cdub5

    Import records step work around in FMgo

    cdub5

      Title

      Import records step work around in FMgo

      Post

      Hi

      I have a database which allows users to fill out carry out interviews whilst out in the field via FMgo. The database holds several sets of questions in a "questions" table. Each set of questions has a related "SurveyID" from a related "surveys" table. When a user starts to carry out an interview they choose a survey to carry out.  An import records step is then triggered, importing all the related "questions" records for their selected survey into another table within the database. From here they pick related responses. Currently this works well with Filemaker Server but i am needing to create an offline version of the database for when users have no wifi/mobile signal coverage.. Unfortunately the imports record step will not work importing into the same file when FMgo is working with a local file. Would anybody be able to suggest a workaround with my script?

      After choosing a survey to carry out:

      not [IsEmpty ( Questions::_fk_SurveyID ) // confirm that question records exist]
        Set Variable [$InterviewID; Value:Interview::__pk_InterviewID //sets their currently selected record ID as a             variable]
        Go to Related Record [Show only related records; From table "Questions"; Using layout: <questions>]
        Sort records by Field [Ascending; Questions::__pk_QuestID}
        Import records [No dialog; "Interviews.fmp12"; Add; Windows ANSI]
        Go to Layout ["InterviewQuestions" (InterviewQuestion)]
        Replace Field Contents [No dialog; InterviewQuestions::_fk_InterviewID; $InterviewID //makes the imported           records related to their interview]
        Go to Layout ["IPAD Main" (interview)]
      End If

      Thanks!


        


       

        • 1. Re: Import records step work around in FMgo
          TSGal

          Connor White:

          Thank you for your post.

          If working from a local file, you will need to reference the "Interviews.fmp12" via the DocumentsPath.  Therefore, just prior to your Import Records script step, insert the following script step:

          Set Variable [ $FilePath ; "filemac:" & Get (DocumentsPath) & "Interview.fmp12" ]

          Then, change your Import Records script step as follows:

          Import Records [ No dialog ; "$FilePath" ; Add ; Mac Roman ]

          Let me know if you run into difficulty or need additional clarification.

          TSGal
          FileMaker, Inc.

          • 2. Re: Import records step work around in FMgo
            cdub5

            Thank you for your answer. Works perfectly