It's possibile to use Insert File with the store by reference option specified to insert a reference to the import file into a container field. You can then extract the file name from the container field and put it in a variable so that you can use it in the Import Records step and if you enable auto-entry options during import, the contents of this same variable can be auto-entered via an auto-entry calculation into a text field defined for this purpose.
The script would look something like this:
Set Error Capture [on]
Insert File [Reference ; YourTable::YourcontainerField ]
IF [ ( Get ( LastError ) = 0 ]
Set Variable [$$Path ; GetValue ( YourTable::YourContainerField ; 2 )]
Import Records [no dialog ; $$Path ; .....]
In the auto-enter calculation for your source field, you'd just use $$Path.
When you run this script, you'll get an open file dialog where you can find and select the import file. The script will then use the reference (File path) to that file to import data from it and auto-enter that file path into the designated text field. If the user cancels the dialog, an error code is returned and no import takes place.
Note: when setting up the Import Records step, include two data source references like this:
Where "Sample File" should be a specific literal reference to a file of the type from which you intend to import. That literal reference enables you to set up your field mapping, but when the script executes, it will give preference to $$Path over the literal reference so your user can select a file for import.
Worked like a charm, thanks again.
I tried this myself but could not get the name of the file to show up in a text field. Any thoughts? I set it up as Phil outlined it. My file type is .edl. Would that be a limiting factor?
If you can manually import from your .edl file, then this is not the issue. Check to make sure that you are using Insert File with the "store as reference" option enabled and make sure that the container field into which you are inserting this reference is physically present on the current layout when you do this.
physically present in the current layout was it. Thanks.