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

Importing..Importing records... am I missing something?


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

Recommended Posts

Posted

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

Posted

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.

Posted

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?

Posted

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.

Posted

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.

Posted

I never found the hard-coding an issue, but delete that source file reference before you ship to make sure.

  • 2 weeks later...
Posted

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

 

post-72145-0-82655800-1364457405_thumb.j

 

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

Posted

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.

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