Not sure of your setup, so please confirm.
You are executing the script to bring the Excel data into FMP on a computer (client ) or on the FM server (as a scheduled script)?
on the server as a scheduled script.
The solution is hosted so the data resides on the server at the path above.
There are plug-ins out there for this kind of thing, like the 24u file plugin and I believe Troi has one, too.
But if your file is already in the container field, you an always export it to the temp directory and import it form there.
Hope this helps.
agnes b. riley . filemaker and web development
FileMaker Business Alliance . FileMaker Technical Network
T 201-299-6223 (NJ) .
FileMaker Certified in 10 and 11
people + products + events + todos + invoices + documents = productivity
ah, but I can't export it to a temp file:
because exporting field contents is not possible via a server scheduled script, unless there's an alternative to that I'm missing.
I'd like to avoid the use of plugins if possible.
Also, can anyone confirm why it would NOT work? (IE is it technically impossible to import a file that resides within the folder structure for my container fields?) As noted, the file can be accessed and opened via the OS with excel, so maybe my import path is incorrect?
Same comment as Agnes. Your script would export the Excel file out of the container to either the Temp folder or the FM server documents folder - with the Temp folder likely being the better choice here. Set a $variable when doing the export and then do your import specifying the source Excel file with the $variable.
as noted, export field contents is not compatible via a server scheduled script.
Is there something I'm missing? I am familiar with setting variables and the rest.
...and you are correct. I had not noticed about this not being server compatible. I have done plenty of export records on the server, but not a container. Sorry about that.
Does the Excel file have to be in a container? I am just thinking workflow here. Perhaps the file could be placed in a consistent location to where it could be picked up by the server script. You would potentially have to be aware of permissions for the server to access the excel file, etc.
Your path to the file seems okay, but maybe FileMaker is intentionally not recognizing this because they don't want external manipulation of remote container data. Total guessing on this though!
You could try a plugin that is server compatible just to see if it could work. I think it would be best to use the plugin to make a copy of the file to the server documents folder. From there, the FM script can see/access the file.
The file is being pulled into a container field via an inbound email that's being processed by the 360Works email plugin.
I suppose I can copy it to the documents folder via a scripted DOS batch file. I was just looking to see if there was any technical limitation or setting that's blocking it from importing.
You would use an FMS script sequence schedule. Use a batch file as the first part of the sequnce to copy the xls file from its RC data loation over to the FMS documents folder (the temp folder option won't work in this scenario), The 2nd part of the sequence is the FM script to import from that xls.
That's what I ended up doing, and I got it to work. The batch file is simple:
copy "C:\Program Files\FileMaker\FileMaker Server\Data\Databases\RC_Data_FMS\DATABASE\Files\DATABASE\Attachment\data\importfile.xls" "C:\Program Files\FileMaker\FileMaker Server\Data\Documents\importfile.xls" /Y
It just copies the data to the server documents folder, which is accessible using the direct path or get(DocumentsPath). the /Y switch is required to overwrite existing copies of importfile.xls without dialog.
PS - Wim, definitely have implemented some changes to our server settings based on your devcon "sleep soundly at night" session.