Thank you for the post.
“All I want to do is import csv files saved to the Desktop - is there a reliable way to do this?”
A csv file can be imported but not from the desktop. "FileMaker Server can only Import from and Export to the following locations:
• When using the Import Records script step or Export Records script step in a FileMaker Server scheduled script, keep the following in mind:
• Any specified file must be in the Documents folder, the temporary folder, or a child folder of either the Documents folder or the temporary folder. For example, the following are all valid paths for file.csv:
The full knowledge base article can be found here:
Thanks TSFalcon - I had read all the info about Importing/Exporting and tried a number of ways but in the end, and after posting my initial question, I read an article on the Soliant blog (http://www.soliantconsulting.com/blog/2014/01/mapping-scripted-imports-variable-paths) so, despite Server not being able to import from the desktop, I gave it a try anyway - and it works consistently.
If it's not good practice then am happy to change it!
My client wants to keep things as simple as possible so when we get a csv registration form emailed from the website, the secretary simply drags the attached csv onto the desktop and it's at that point we need to import the data. Have been doing that for some time on a standalone FMPro but once we moved to the server the method I was using didn't work any more - hence the question.
In those circumstances, what would you recommend?
Thanks for your help - much appreciated.
Thank you for the reply.
“so, despite Server not being able to import from the desktop, I gave it a try anyway - and it works consistently.”
To confirm, the script is being run as server side script and not via FileMaker Pro?
FileMaker Pro can import (even to a hosted file) from any accessible path. I don’t know if one way is necessarily better than the other way, but if you’ve got it working and the workflow is streamlined, then I would keep the process as is.
WoW Fast Response - thank you.
I tried various server-side appoaches but couldn't get any of them to work consistently, and had a variety of error messages - mostly 100 even though the variable did indeed lead directly to the file!
I think the pragmatic approach is the one I've settled on for now but would really like to know how to create a variable eg $path that can hold the path to the hosted csv and not lead to so many errors - if there's any resources you can refer me to I'd certainly appreciate it.
Please review the following forum thread:
I wrote a script in that thread that performs an export and import via Perform Script on Server using WebDirect. The basic principles should be the same; however, the user will need to copy the csv file to the FileMaker Server documents folder.
Thanks again - will check this out and see what I can come up with.
One approach I explored but could't get to work consistently is:
Whereas the sample file works fine, transferring the approach to my db caused a number of problems I could't bottom out - will go back to it at some point though :-)
Thanks again for your great support