05. Pull Contacts, Calendar, Tasks, and Notes [5:55]

Description: This video reviews how to pull Calendar, Contacts, Tasks, and Notes from Outlook into FileMaker.


0:05 Hi, in this video we’re going to take a look at pulling Contacts, Calendars, Tasks, and Notes.

0:09 Okay, here is our demo on the left and on the right I have Outlook situated with the contact list in front of me.

0:15 Alright, so let’s go look at how we do this. Go to the Pull Contacts area of the demo. You can see here I have zero records in the Found Set, and I am going to go ahead and click Pull, and what that will do is it will go through and literally go record to record and pull each one in. As it pulls each one in, it is creating a new FileMaker record.

0:35 There – I have just pulled 500 records and that was in real time. And you can see I’ve got the first, last, and all the main fields that you would normally want to pull.

0:45 Alright, let’s go look under the hood how the script is designed.

0:52 Alright, the name of the script is Contacts – Extract Contacts from Outlook to FileMaker. Most of the script is housekeeping, the real work is down here, but let’s follow it anyway.

1:03 So,the first thing we do is we show all records and delete all records in FileMaker. That’s just if we already had records in here we would delete them all.

1:11 Then we call the normal housekeeping routines and make sure that authenticate has been called. We’re going to open the Contacts folder – or module – Contacts.

1:20 Check if there’s errors. And then, the first command we do is we call the “GetRecordCount”, which is very similar to FileMaker’s record count in that we can count the number of records in Outlook’s Contact’s module.

1:33 The only reason we do that here is that we warn people that if there are a lot of contacts they are pulling, we warn them that, you know, it may take several seconds for that to arrive.

1:43 And the rest of this is just more of the same, if there is more than a 100 records, we warn the user. Then we create a new FileMaker record, so we have a place to put our first record.

1:54 And then we call the “GetFirstRecord” command right here in Outlook, and then when we call that we set it to the Outlook ID so that when that record is created we have the Outlook ID so that we can reference it later if we want to edit it or delete it or view it.

2:12 Alright, and then we, field by field, we pull each field, based on the names of the fields needed in Outlook, and we populate FileMaker. And then we have this whole thing in a loop so that we can determine if the “Found Count” equals the count that we stored based on this “GetRecordCount” up here. If those match then we’re done with the routine, and we are complete with the process.

2:37 So that’s essentially it. We go through and create a record for every record in Outlook.

2:43 Alright, now let’s take a look at the tenth or twelfth record here and let’s go view that in Outlook. I can click “View in Outlook” and it’ll bring that exact record up – now that we have the ID – and we talk a little bit more about that in some of our other videos.

2:58 Alright, if I go back to the main demo, I can do the same thing with Calendars and Notes, Tasks, and so forth. Let’s go take a look at running the script with debugger, so that we can see firsthand how it all works.

3:17 Let’s concentrate back on the Contacts since we’ve already done that. So let’s run the debugger this time and do the exact same thing.

3:26 And we’re going to go ahead and pull – I’ll put my debugger over here – and we’re going to pull that. OK. Use F6 on the keyboard to make it easy.

3:38 Alright, so it is going to show all the records, it is going to delete all the records, and it’s going to check to see that we authenticated. We had already done that earlier, so it doesn’t need to do it again.

3:50 Now we’re back to extracting the folders. That’s just a routine that it does when it authenticates – part of our demo extracts folders for the email just to be sure that we always have the latest version of folders on hand.

4:05 So let me just go to the end of this. Zoom through that. OK. Now we’re back in our main script here and we’re going to open the folder – in this case it is going to be Contacts. Let’s go ahead and show the data viewer.

4:21 So you can see that – and that result just means success.

4:28 Alright, so we have opened the folder and now we’re going to get the count, like we talked about a minute ago, and it shows that the count is 500, means there are 500 contacts in Outlook ready to be pulled.

4:40 OK, the message is greater than 100, so we show and warn the user that it might take several seconds. Then we freeze the window just to keep it speedy. Then we create our first new record here in FileMaker, and we grab the first record and populate the ID. Then we are going to set field by field, pulling directly from Outlook, and then new record and repeat and this repeats for 500 times.

5:11 And, really, that is it. At the end, we just commit that last record and we’re done.

5:16 So that is a close up view of how we do Contact pull.

5:22 All the other modules that we talked about: Tasks, Notes, and Calendar work identically, except that their fields are a little different, you can refer to the documentation for the field names and how they are used in Outlook.

5:35 That documentation is available right on our demo here under the Doc Library.

5:40 To learn more contact us at Sales@productivecomputing.com or visit our website www.productivecomputing.com. Thank you for watching.