Jump 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.

Featured Replies

Hello,

I am trying to figure out a way to auto-import print job log (CSV file) into the FIlemaker every day. I know that I can schedule to run a script on Server.

Now, the real issue is to setup script step where I add file. I want to import everyday log file which has that date as filename , so it's not same file I am importing.. everyday it changes and my scheduled script will import file at specific time from Server remotely.

I would appreciate any suggestion.

 

Thank you

Edited by dav1089

I am not sure I understand what your question is about.

23 minutes ago, dav1089 said:

I want to import everyday log file which has that date as filename

Define a variable to construct the path to the file dynamically - for example:

Set Variable [ $filePath; Value:"file:" & Get ( DocumentsPath )  & Year ( Get ( CurrentDate ) ) & SerialIncrement ( "00" ; Month 
( Get ( CurrentDate ) ) ) & SerialIncrement ( "00" ; Day ( Get ( CurrentDate ) ) )  & ".csv" ] 

If run today, this will return the path to a file named "20160623.csv" located in the Documents folder.

 

21 minutes ago, dav1089 said:

Now, the real issue is to setup script step where I add file.

There is no step to "add a file". If you want to import from a file, then you need to use the Import Records [] step. In this step, use the $filePath variable to specify the file to import.

 

See http://www.filemaker.com/help/15/fmp/en/#page/FMP_Help%2Fimport-records.html%23 regarding the limitations of the Import Records[] step when performed on the server.

 

 

  • Author
4 minutes ago, comment said:

Set Variable [ $filePath; Value:"file:" & Get ( DocumentsPath ) & Year ( Get ( CurrentDate ) ) & SerialIncrement ( "00" ; Month ( Get ( CurrentDate ) ) ) & SerialIncrement ( "00" ; Day ( Get ( CurrentDate ) ) ) & ".csv" ]

Will it be file: or fmnet: ?? File will be hosted in the Server and sorry I want to auto-import from remote client where logs are stored.

Edited by dav1089

Please read the link I have posted, esp. this part:

Quote

Any specified file must be in the FileMaker Server Documents folder, the temporary folder, or a child folder of either the FileMaker Server Documents folder or the temporary folder.

 

  • Author

Hi,

I can't get it working  (FIle Name is Job Log_3_JUN_2016.csv ) .. I used :

"file:"& Get ( DocumentsPath ) &"Job Log Dump/Job Log_" &  Day ( Get ( CurrentDate ) )  & "_" & Upper ( Left ( MonthName ( Get ( CurrentDate ) ) ; 3 ) ) & "_" & Year ( Get ( CurrentDate ) ) & ".csv" as Local Variable Value

The Log Files are in Documents/Job Log Dump Folder on Server Now. 

 

Will it work if I make the Path absolute instead of relative (Get (DocumentsPath) )?

Edited by dav1089

  • Author

Hi,

So I was able to map the fields and schedule script in the Filemaker Server .. Now, The schedule runs fine with no error and I receive notification: 

Screen Shot 2016-06-27 at 2.42.19 PM.png

But it doesn't actually import any records into the file

Now to troubleshoot this, I ran the script manually and it imported records fine...

So what is missing?

Create an account or sign in to comment

Important Information

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

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.