Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Importing Help

Featured Replies

Hi, was wondering if you FM gurus would help me with something.

I'm trying to parse an html form e-mail response. The html form has several fields like: 1a, 2a, 3a, 3a1, etc. I have all the fields setup in FM corresponding to all the form fields.

The question is, can I paste the e-mail response into a text field in FM and then have FM go through each line and match up the text and fields?

A typical e-mail response would be...

1a = Yes

2a = No

3a1 = Yes

4a = No

My FM fields are...

1a, 2a, 3a, 3a1, 4a.

As you can see, the html e-mail response might not return all the fields that are in my FM database.

Thanks,

Kermy

One way might be to set the responses up so that the include a fiels identifier in them... then parse looking for the field identifier. Or, ensure that the responses always included all fields.

  • Author

Well the form's e-mail response gives me the field name seperated by a "=" and then the value. But the problem is that the e-mail might not have some of the fields returned if the user doesn't check one of the checkboxes.

I would import the file into a special FM file intended just for this import process.

It would have one data field called "iLine" (imported line).

Then two calculated fields:

cField = Left(iLine, Position(iLine, " = ", 1, 1) -1

cValue = Right(iLine, Length(iLine) - Position(iLine, " = ", 1, 1) -2)

Then you write a script SetFields (or "CreateNewWhatever") in this import file that loops through the records and does a series of If checks on cField and then a set of the appropriate field in your real file to cValue.

One more script might make sense: DoIt, which deletes all records and then does the import from a specified email file, and then invokes the SetFields script.

HTH.

  • Author

Hi kennedy, thanks for the tips, but wondering if you have a sample script like is that? Relative newbie to FM scripting.

Thanks =)

Well, generally when doing such a import file, I am importing from one proprietary format into another. In pseudo-english:

Show All Records

Go to Record [First]

Loop

If [ cField = "1a" ]

SetField("1a", cValue)

Else

If [ cField = "1b" ]

...

End If

End If

Go to Record [Next, Exit Loop If Last]

End Loop

Now to make that more robust, you might want to change the simple SetField to check first if the field has already been set and the respond appropriately (the email has two lines setting the same field). After the loop you may want to check for unset fields. Or before the loop, you may want to set defaults up.

HTH.

  • Author

Thanks for your help, but wondering if you can take a look at the database. It doesn't exactly work tho. Maybe it'll help to clarify my situation.

As you can see, I have that field "BigTextField" that has information copied and pasted from an e-mail. And I have the other fields. From the Parsing script, it would search for "Name = " in the "BigTextField" and then I was hoping it would return everything to the right of "Name = " up till the next line to the "Name" field.

Test.zip

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.