March 17, 201312 yr Hello, I am using FMA 12 for Mac. When I create a script using the import records script step, I can see the options where it shows me on the right the table and fields, but the on the left the source file is empty. My file is set to a global variable which will have the path when the script is actually run. My question is how to do the mapping when in the import script step I don't see the actual file on the left? What am I missing so as to set the script up and able to map the fields? Thanks for any thoughts. Stephen
March 17, 201312 yr In order to define the mapping, you need to specify an actual file at least once. Once the mapping is defined, you can leave just the $var in the source file dialog.
March 17, 201312 yr Author Thanks. My import will be part of a script that has roughly 30 imports. So I would temporarily remove the variable and set up the import. Then redirect the file to my variable?
March 17, 201312 yr Close. The source file dialog allows for multiple "source files" and FM will look for them starting at the top and working down. So, put the $var first and the "hard-coded" file second. The "file" is not redirected in one step. Each import step needs to be defined to use the $var.
March 17, 201312 yr Author Close. The source file dialog allows for multiple "source files" and FM will look for them starting at the top and working down. So, put the $var first and the "hard-coded" file second. The "file" is not redirected in one step. Each import step needs to be defined to use the $var. Thanks for your help. So let me see if I understand this correctly. I have my global variable which holds the path and when I define the file in the script step, I actually place two lines. The variable first and the "hard-coded" location. Since the script will attempt to find the file from top down, it will find the second one during my development but while it is actually being used, it will find the first. Since they will be pointing to the "same file", the mapping settings will remain. Since my .fmp12 file in development will be packaged into a runtime, will my hard-coding cause an issue? Thanks again.
March 18, 201312 yr I never found the hard-coding an issue, but delete that source file reference before you ship to make sure.
March 28, 201312 yr I've climbed this mountain and hope you can benefit from my experience. I too work in OSX. Below is a sample of my import code. My path variable is $$path is a created from using the 360Works ScriptMaster (free) plugin   In the area above IMPORT========== I am go to specified layouts based on layouts that I want to delete all the records. Below Import =========== I go to the same layout as above and them import all records; finding the file from the global $$path variable. It works well.  This works well in Development mode. But, I am finding that in the runtime app, FM produces a 'progress bar' dialog that says something like 23456 records being copied if I use Save As.... to create a backup copy of my program data. This is weird for several reasons. 1) My saved file has 61 records in it. and 2) If I Save As... a version of my app and then Save As a second time with the same name, the file gets twice as large.  Onward through the fog.  Hope this helps  Ron
March 28, 201312 yr Author Ron, This is almost identical to how I have my import script for about 20+ tables in my runtime. I have a global variable for the path. I learned here to add a physical file in the file sources so as to set properly the import order. It has worked just fine for me and much easier to modify having this second physical file declared. Thanks for the input. PS - I don't have that extra bloat you mention regarding the file. That's weird.
Create an account or sign in to comment