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

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

Recommended Posts

Posted (edited)

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
Posted

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.

 

 

  • Like 1
Posted (edited)
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
Posted

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.

 

  • Like 1
Posted (edited)

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
Posted

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?

This topic is 3069 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.