Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How to bring (emailed) form "data" into a FM DB?


This topic is 7986 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Here's the problem:

On my web site, I have a PHP form which the user fills in, then clicks a button to "Submit." The data is returned to me as an email, and looks something like this (after the header is removed): <sample data starts below>

realname: John Lincoln

nationality: USA

email: [email protected]

computer: Mac

</end of sample data>

So, the data arrives as an email in this format:

(category)(colon)(space)(data)(carriage return)(carriage return)

(category)(colon)(space)(data)(carriage return)(carriage return)

(category)(colon)(space)(data)(carriage return)(carriage return)

etc.

Rather than collect a series of individual emails with text data like this, I want to input the data into a FileMaker database, where I can count, measure, and manage it, based on all of the given categories.

Here's how far I've gotten:

1. I can open each individual email and COPY the sectioning containing the data (formatted as above).

2. I can PASTE the selection into a new text file, then SAVE it.

3. I can design a blank FileMaker database with all of the appropriate categories.

4. But here's where my problem appears. How can I IMPORT the field data from the text file into a new record in the FM database?

5. As an interim step, I can OPEN the text file in MS Excel

Posted

Well, for a plugin, you could look at POP3it by www.cnsplug-ins.com

this allows you to bring emails straight into FileMaker Pro. You would want the address to be one that only filemaker looks at.

Its a start. Otherwise, you would want to look at ways of parsing the information from a single field into your actual FileMaker fields.

HTH

Posted

If the email is coming to you from a form it should be fairly easy to parse out the info into the appropriate fields in your FMP solution. I did something similar to sort out messages from a FM forum that sends out posts to the board in a daily email. I just copy the email and post it into a global field, then run my script. The script creates a new record, strips out the date,time,subject,user,subject for each of the individual posts within the email.

Posted

Since you are a mac user, you can use applescript extract your data. I recommend the book AppleScript for the Internet. It gives a number of examples using different email clients to parse email data.

Here is a script I just found at the macscripter script builder archive. It is from Diana Cassady and is copied below in its entirety, [The line breaks are not coming across, I apologize. Please see attachment.]

(*This script was provided by Diana of VivaLaData - http://www.vivaladata.com.

You're welcome to use it at your own risk, but please leave this statement in tact.

The purpose of this script is to export messages from the inbox of Outlook into Filemaker.

I run this script with with inbox as the front most mailbox. Your target database must also

be the front most database. The field names I'm using are message, from, subject, and date_sent.

They're all text fields. You can alter them below if necessary. I'm using Outlook Express 5.02

and Filemaker 5, but it should work with other versions of Filemaker and probably other versions of Outlook as well.*)

tell application "Outlook Express"

set totalmessages to count messages of folder 1

repeat with x from 1 to totalmessages

set mymessage to content of message x of folder 1

set mysender to sender of message x of folder 1

set senderaddress to address of mysender

set sendername to display name of mysender

set myfrom to sendername & " <" & senderaddress & ">" as string

set mysubject to subject of message x of folder 1

set mydate to time received of message x of folder 1 as string

tell application "FileMaker Pro"

set newrec to create new record of database 1

--If your field names in Filemaker vary, you can edit them here.

set cell "message" of newrec to mymessage

set cell "from" of newrec to myfrom

set cell "subject" of newrec to mysubject

set cell "date_sent" of newrec to mydate

end tell

end repeat

end tell

This topic is 7986 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.