If you can specify the name and location of the file in the script step, it will also retain the worksheet that you specify at the same time.
Just ran Import Records from FMPA 15 and it imported the specified worksheet without asking me to select the sheet, as I made that selection when setting up the import records step.
I forgot to mention my script uses a temporary file path to pull from a container [in this case, component_tracking: Import RFQ] that I drop my Excel workbook (with Survey and Import) in as two tabs. So when I run the script, a window pops up and it shows me the name of both sheets and I can choose the Import sheet through a menu.
If I use a temporary file path in this way, can I specify that when I export the container contents it will be an excel sheet and I'm looking for a specific worksheet? I've pasted the code below for reference. I'm guessing it would happen in line 13... Thanks!
That variable for the filepath creates an issue during script development that takes a bit of creativity to work around. At the time you set up the import script step, put two file references into the dialog instead of just the $path variable:
Reference to a file that exists and is an example of what you want to import from here
You can use the add file button to add the second line. During script development, $Filepath does not exist and the reference "falls thru" and uses the second row to access a file for import. You can then do the needed field mapping and specify the worksheet that you want and these settings will be retained in your script.
When you run the script, $Path has a valid reference to a file and so the second row is not used. It's a good idea to make sure, by moving or renaming the example file. That way, if some error produces a $Filepath variable with an invalid path, the script doesn't import from the example file.