05. Pull Contacts, Calendar, Tasks & Notes [7:11]

Description: This video demonstrates FileMaker Pro pulling Contacts, Calendar items, Tasks and Notes from Microsoft Outlook.


Hi, in this video were going to take a look at pulling data from Outlook to FileMaker. Open up the beginner demo file, register the plug-in, authenticate with Outlook – and let’s go pull some contacts. And we’ll click the “Pull” button. This just brought in 67 contacts from our Outlook – complete with the Outlook ID and in this case, the sample data includes first and last name, business phone, and in some cases a business fax, e-mail, and also the modification date.  So let’s take a look at how that works through the script.


1:00 First we delete any previous records that were in FileMaker. We do a show all and delete all records. Then we call the “Authenticate” script. And then the first command is the  “PCEM_OpenFolder”. That tells Outlook which folder we’d like to work with and in this area we are specifying the folder you saw earlier which was  “/contacts”. It just tells Outlook which folder to open. Then the next thing is we determine how many contacts there are in that Outlook folder by calling the “PCEM_GetRecordCount”. Then we create a new record in FileMaker and then call the “PCEM_GetFirstRecord”. That tells the pointer in Outlook to position itself on the first record within the contacts folder.


2:10 Then we simply start populating FileMaker fields by using the “PCEM_GetFieldData” command and within that we specify the name of the Outlook field. For a complete list of Outlook field names, refer to the “Fields and Functions” PDF included in the download package. So we pull first name, last name, company, and some other selected fields. There are quite a few additional fields beyond what you see here that are available.  And we’re running this in a loop so that we can import multiple records and this command here says if the found count equals the current number of records in a found set, then exit the loop, otherwise, continue making new records and continue pulling records from Outlook.


3:02 So after the first record is pulled, the loop will come into this script step which calls the “PCEM_GetNextRecord” command that tells the pointer in Outlook to go to the next record. So we simply grab the first record, bring in all the fields, go to the next record, and so on until the count of the records equals the number of records in FileMaker.  There’s also a “View in Outlook” button which will bring up the contact detail pane in Outlook. Let’s go back to the main demo and let’s talk about pulling calendar events.


3:56 In Outlook we should have a few calendar events already created and we’ve created these so that each calendar event has its own category. “Blue”, a category for “FMP” which was a custom category we created in Outlook, and “Red” category. You can see here we have the blue category, the red, and FMP category. Let’s go take a look at that script.  Again, we do a show all in FileMaker. Then we delete all the records, perform authenticate, and just like we saw earlier, we called the open folder command –  this time we’re specifying the folder “calendar”.


4:47 We get the record count of the calendar records in Outlook – store that in a variable. Then we get the first record and begin to pull all the fields – start, end, subject. The start and end fields in Outlook are timestamp fields. and then we create new records – we get the the next record and we continue that until the found count FileMaker matches are found count in Outlook. You can also view appointments directly from FileMaker by clicking this button. Let’s go take a look at that script for viewing data.


5:48 In this sample, we first called the “PCEM_OpenRecord” and we specify the Outlook ID which we acquired when we pulled the record in from the earlier script. Then we called the “PCEM_Display” and that will simply take the Outlook ID of the one you specified and display it.


6:16 We can also pull notes. So here in Outlook we have three sample notes. Pull those now. Again, these scripts all work the same way. To extract notes we open the Notes folder, get the record count, and begin by calling the get first record, pull in the various data points into FileMaker, create new records, get the next record, and so forth. You can also pull in various tasks.

Tags: , , , , ,