6 Replies Latest reply on Aug 14, 2012 10:49 PM by philmodjunk

    Export ICS

    LambdaEnt

      Title

      Export ICS

      Post

      I need to export found records as a single ICS file, for import/syncronization with (Mountain Lion) Reminders.

      This requires a header, individual lines for each record, and a footer.

      Here is what a sample ICS file would contain:

      BEGIN:VCALENDAR
      VERSION:2.0
      BEGIN:VTODO
      SUMMARY:Record1
      UID:FMP1
      END:VTODO
      BEGIN:VTODO
      SUMMARY:Record2
      UID:FMP2
      END:VTODO
      BEGIN:VTODO
      SUMMARY:Record3
      UID:FMP3
      END:VTODO
      END:VCALENDAR

        • 1. Re: Export ICS
          philmodjunk

          It's difficult to correlate the parts of this sample output to fields in a database table. I see what looks like a two line header and then text: Begin: VTODO that serves as a 'header' for the record and End:VTODO that serves as the terminatory or "footer". In between you you have two lines of text that appears to come from your FileMaker table. Are Summary and UID field names? and "Record1" and "FMP1" values in these fields?

          It looks like you might be able to set up a text field where you enter all of this data, then use Export Field Contents to generate the file.

          There are several ways to pull all this data from your table into such a field. The List function via a relationship that matches to the reocrds you want to export is one option. Copy All Records on a special layout followed by pasting the copied text into a text field might also work.

          • 2. Re: Export ICS
            LambdaEnt

            Yes "Record#" and "FMP#" are values in the corresponding records.

            I could create a calculation to add the necessary text for each record.

            If there is a way to have a single field concatenate all found records?

            I could then create another calculation to add the necessary header and footer, then a script to export that record.

            Also, is it possible to have the file extension set to .ICS?

            • 3. Re: Export ICS
              philmodjunk

              Export field contents can use a variable to specify the filepath and file name. It can include .ICS as the file extension.

              Try this approach, it relies on a relationship that matches to just the records you want to export--a detail I can't specify from what you have posted so far.

              Define a calculation field in your table, named cFieldList:

              List ( "BEGIN:VTODO" ; "Summary:" & YourTable::SummaryField ; "UID:" & YourTable::UIDField ; "END:VTODO" )

              Then define this calculation from the parent table where you will build your text field for export:

              List ( YourTable::cFieldList )

              That should leave you just the header and footer entries:

              List ( "BEGIN:VCALENDAR" ; "VERSION:2.0" ; List ( YourTable::cFieldList ) ; "END:VCALENDAR" )

              • 4. Re: Export ICS
                LambdaEnt

                Got it! I was unfamiliar with the List funtion.

                Except for defining the set...

                There is a field (essentially a checkbox) that is empty if it should be included, or value of 1 if not. However, I already have a script that find only such records.

                • 5. Re: Export ICS
                  LambdaEnt
                  Was it clear that there is still a question?
                  • 6. Re: Export ICS
                    philmodjunk

                    It was clear, but after spending the entire night in the ER with a family member, I only saw these posts just now.

                    You can set up a calculaiton field that returns True if your selection field is empty:

                    IsEmpty ( SelectionField )

                    Then a calculation field: constOne defined with the lone value 1 in the specify calculation dialog.

                    Then a SelfJoin relationship can match on these two fields to produce the desired set of related records.