Use the "Get Directory" script step to let your user specify the folder path, and then set that folder path to a global variable which you can use later throughout all your other scripts.
1 of 1 people found this helpful
Define a container field. I usually make it a global field as you need just the one instance of this field.
Use Insert file to insert a file with the "store a reference" option specified. When this step executes, you'll see the open file dialog and you can select your original file and this inserts a "reference" to the file into the container field.
Set Variable [$Path ; GetValue ( YourTable::YourContainerField ; ValueCount ( YourTable::YourContainerFIeld ) ) ]
Will extract the needed file path to that file for use with your Import Records steps.
When using a $Path variable with import Records, it's important to put in a reference to a file that is valid at the time you define the script step in order to set up and retain all your import options and field mapping:
Valid File Reference created by "add file" goes here
Thank you guys,
I will try both solution ant let you know.
One more, I hope not stupid question,
Is there a way if I have 2 solution with the exact same tables, to import all the datas in the table of "Solution" into "Solution1" with one shot?
All in one script, yes. All in one script step, no.
I'm trying to follow you're instruction, but I have few questions.
The container field you mentioned where should I create it, since I have in my solution around 20 Tables. In each of them, or in just one random table in order to define the file path ?
After this do I have to repeat the import script line for each one of the tables, am I correct?
Thank you again
so yes, just a random container field - and it looks like you got that working. Cool method.
Now, if you want this to happen without dialog for your end users, I believe that you need a separate Import script step for each table that you want to import. I don't think you can loop this without making the user interact with the Import Records script step. So, you'll need to define the table you're importing from along with matching the field names in each Import.
You are right.
I have to check now the data import correct procedure.....
I have an Issue with the script.
Although before importing any record i open the related layout.
"import with $Path"
all the records are imported in one single table.....and is not the one linked in the variable $Path with the container field.
Anybody knows why?!
I think I know why.....
I copied and pasted the same import line that link to the same table.......
Ok, solved the mistake.
Now I have another issue.
As you can see in the enclose attachment, once I choose in the script "Import Records", I can select the "Target" Table, but I cannot choose the origin Table to import with the $Path.
What am I missing
Is weird, because i can make the script work as long as i run it the first time with the option "Perform without dialog.." not selected.
In this case the script will ask me the correct table to import, and after. Just offers the first run, I can "Hide the dialog" and the script will remember the correct source table to import.
Is'n it a bit weird?
I'm still working on it to understand why is doing so,