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 files when target filename is changing

Featured Replies

  • Newbies

I need to import records from csv files generated by another application. My problem is that the filename changes daily. I can create the target filename and path easily using a field and functions, but import or file open don't seem to have a way of picking up the target filename from that field.

I've probably missed something obvious, but does anyone have a suggestion ?

FileMaker only imports from a fixed file and location, which must be set up in an Import script step. So, the technique, if you want to automate this, is to use another tool, such as AppleScript, to:

1. take the file you want to import,

2. move/rename it to the fixed FileMaker import file

3. Import it

4. move/rename it back (optionally to a "Done" folder)

You need an original "dummy" csv file, with the fields (columns) needed, to set up the fixed Import step. But then that file can be moved/deleted. The new file(s) become that file during the import.

I have some examples for doing this, but they are for importing ALL the files in an "Import" folder, hence they're in a Loop. Also they're in FileMaker 7. I decided to dump my FileMaker 5-6 examples (housekeeping). So the attached example has a version 7 database. But the AppleScripts themselves are included as source files (though they are in FileMaker Perform AppleScript steps in the file).

I do have an Import Excel example in 5-6, if you need it. The routines are the same, but the Import step is set up slightly different. It was kind of a pain to set up (and especially to modify) imports in 6 compared to 7.

[There is actually an alternative method to do csv imports with AppleScript. Which is to read/parse the file's contents in AppleScript itself and set the FileMaker fields from there. It's quicker for small files. But a bit geeky, and not much tested :-]

Import_wFM.zip

  • Author
  • Newbies

Hi Fenton

Thanks for the reply. It has saved me wasting a lot of time trying to do something FM can't do.

I've worked around by creating an intermediate FM file which two FM files now use. There is a minute chance of losing a couple of records - the external application, over which I've no control, switches files around at exactly midnight - but I can live with this for the time being.

Many regards

Noel Welpton

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.