3 Replies Latest reply on Oct 20, 2014 1:54 PM by tjfure

    Drag and Drop from Text to Record



      Drag and Drop from Text to Record


      I'm relatively new to FM and using FM Pro 13 on a mac, but used MS Access for years.  I would like to be able to drag and drop text from an e-mail with the following format into a record in my database with the exact same field names.  I have been reading about containers and portals in the forums and trying several different combinations with no progress.  Is there a way to do this in FileMaker?

      First Name: john 
      Last Name: doe
      Email Address: john.doe@abc.com
      Telephone: 000-000-0000
      Company: ABC Co.
      Address: 100 ABC Drive 
      City: San Jose 
      State: CA
      Postal Code: 12345
      Question: How do I do this and that??

        • 1. Re: Drag and Drop from Text to Record

          And you want the dropped text to be parsed into each of the fields of that record?

          You'd need to drag and drop into a text field and then a script--which could be performed by the onObjectModify trigger, would have to parse the data from that text into the individual fields.

          The fact that your text has one value to a row and a colon separates the field name from the field value should make parsing this text fairly straight forward.

          • 2. Re: Drag and Drop from Text to Record

            This file shows a method of parsing the text, and setting fields with the SAME name. It uses the "Set Field By Name" script step; so the names must be exactly the same. [ I added a step which will tell you want text does not match, just in case.] It is not really "simple", but is mostly just text parsing, and field naming. My version demands the fields to be on the layout, as it is testing against them to see which field matches. It is withing a Loop, but does it for one record. I put a button to run it, but you could do it via a method like Phil said (or similar). It could be made a little safer, like stopping changes, etc.; but this is a basic method. ( I called it "Mini vCard", as it looks much like a vCard, but simpler.)


            • 3. Re: Drag and Drop from Text to Record

              Thank you both!  This is just what I was looking for and with little work, I can combine the two so that I can drag, drop, and parse in one step.  Thank you.