2 Replies Latest reply on May 27, 2016 2:29 PM by fmkelly

    Importing Contacts

    lboyer30

      Title

      Importing Contacts

      Post

      Hello,

      I am looking for an easy way to allow the users of my database to import/export their contacts into my solution. In the FM help menu, they suggest searching for  “vCard to CSV” and choosing one of those converters - does anyone have one that they recommend?  I have also seen an app that you can buy to convert the contacts but I do not want my users to have to purchase an app.  Is there really no other option out there?  Ideally I would like to set up something in the solution that does this, or have a plug-in that would do this for me.  Any suggestions or ideas would be helpful.  

      I also found this from Soliant: http://www.soliantconsulting.com/blog/2009/02/manage-your-contacts-import-vcards-into-filemaker-pro

      I haven't tried it yet since it is from 2009, I thought maybe there would be some improvements/better integration with importing contacts with FM13 since then and would see if anyone had any suggestions.

      Thanks in advance for your help!

       

        • 1. Re: Importing Contacts
          FentonJones

          I don't know if anyone has later/better. I looked at (and tested) the file over a bit, and it seemed well done. [ It is also the only FileMaker file I had, when I looked thru my files {and I have a lot}.] The scripts seem longer that you might expect. But they are well documented. There is just more to look at when moving VCard (text) to different fields in FileMaker.

          I tried this with some ".vcf" files (from my Address Book {Mac} app); which was using Version:3.0. The script got it in correctly (for what it was asking for, and that was a fair number of fields). It did both "home" and "work", but it only did the calculation fields* for "work"; it would be easy enough to dupe the above, and change the word "work" to "home"; naming the fields accordingly. 

          One thing you might want to add would be to modify the field he sets the "VCard" into. He sets it (all its text) into a global Text type field; he did this into a single record "globals" table. What you might want to do instead would be to have that field in the SAME record where the "person" is. Because that way you'd be saving the entire VCard data, rather than LOSING it from the global (which would happen). 

          That way you'd save the VCard in a single field, when you Imported it, and would then be ready to easily Export later, if you wanted to. As you said you wanted both Import and Export. It is not hard to add this to the Import script. Create a new Field, say "vCard" (or "vCard_txt"). Then set it to the global field, "vCardImport::vCard_Text". [ All the "set fields" comes as the very end of the "sub-script". Everything before that is just setting variables. Also, most of the "final data" is actually calculation fields, as they required more tweaking just to show them correctly. You could add regular fields, which could be set by those calculations; as you might want just plain regular fields for such things as "first name", etc., all easily done.]

          The Export can be done, for a single records vCard, by using the Export Field Contents, after telling it what the file will be named, and where to put it (desktop, folder?). To just put it on the Desktop you'd use something like:
          Set Variable [ $path; Value: "file:" & Get ( DesktopPath ) & vCardContact::Name_Formatted & ".vcf" ]
          Export Field Contents [ vCardContact::vCard; $path ]

          There is one thing; Export Field Contents comes out as UTF 16. Which may or may not work for all other apps and .vsf files. I do not know for sure. So let use know, as there are other (more complex) ways to Export with.

          • 2. Re: Importing Contacts
            fmkelly

            I was also trying to get my iPhone contacts into my 'special' Contact list in Filemaker Go (iPhone).  I am not a full blown developer, and I was having a crazy time.  Thanks to a post at the University of Wisconsin, I was able to accomplish this task in a roundabout way.  But, it got r done...  Here's what I did:

            1) Output my iPhone contacts to a vcf (vCard) file

            2) Exported the vcf file via Air Drop to my iMac

            3) Ran the vcf file through the VCF -> CSV converter (the link is below)

            4) Before hitting "IMPORT", I had to match up some of the Source and Target fields

            5) Imported the CSV file to my Filemaker database

            6) Saved A Copy of the Filemaker database

            7) Airdropped the Filemaker copy to my iPhone

            8) Opened the copy in Filemaker Go

            Everything was there, including the photos in container fields, as well as a unique layout and script created just for the application.

            Here's the link that got me going in the right direction...

            https://kb.wisc.edu/helpdesk/page.php?id=38443