Imported File name in new column

I hope I can get some direction on how to do this.

I am importing files and execute different action on it.
I want to make sure I have imported the correct file in the correct table.

i.e. -
20181027 xxxxx - will be imported into Current table
20181026 xxxxx - will be imported into Previous table

The next day
20181027 xxxxx - will be imported into Previous table
20181028 xxxxx - will be imported into Current table

I know about the List of file action - but that does not work for me.
I can see from the documentation that I imported the correct file to the correct table

I only send the “results” to the customer.
Is there a way that I can either:

  1. Get the file name imported into the table from the documentation and add it as a column
  2. Get the file name after importing it and add it as a column


I would use the “List of files” action, sort it by timestamp, keep only the last 2 file names, pivot them into 2 columns and 1 row. Then I would use “Iterate” to call another project that has two parameters – one for file name for “Current” table, the other one for “Previous”. These parameters are assigned with file names from the two columns.

See example below:
master.morph (3.5 KB)
load files.morph (2.4 KB)

Thank you, Dmitry.

I think this is great. I cannot get the last step to work - get a worksheet or name range error when trying to import and excel file in the master and parameter { current} has invalid value for File name in load.

It is probably something small.

See screenshot

I am still trying to get my head around “project to run”. I have both morph files open. Is that correct?


It’s not clear what causes the problem.

Can you open load files.morph and manually assign its parameters Current and Previous with the values from the table in project master.morph? To assign parameters press F6 or press “Edit parameters” in menu Project.

When you have parameters assigned in load files.morph run it, and post a screenshot of the result or errors.

I am 1 step closer - do not get error msg anymore in Master file.
When I assign manual values in Loadupdate, it keeps the values and do not take on the new values from master.

See attached

20181027 - Complete Record Set.xlsx (8.2 KB)

20181028 - Complete Record Set.xlsx (8.2 KB)
20181029 - Complete Record Set.xlsx (8.2 KB)
master.morph (4.1 KB)
load filesUpdated.morph (2.9 KB)

Everything looks good to me. The project was executed successfully. I suspect that you have load files opened and expecting that its parameter values will change automatically once you execute master. It doesn’t work like that. When iterating/calling another project, EasyMorph loads and executes this project internally, not opening another window or modifying data in already opened application instance.

You can keep adding actions to load files – they will be executed for the correct files. For instance, you can add an export action that will export the contents of “Current” table into a temp file on your desktop. You will see that this file contains current data.

Thanks, Dmitry

This is excellent.

I got this to work on my example file.
I have, however, run into a problem with my load file - original one.

I export a few tables to excel.

It seems that the export of some tables try to be executed at the same time.
4 of my tables export fine - then 2 always get stuck.
I use Mode: Replace sheet

This is the error msg I get.


If I then run these 2 actions manually, it then exports.
Until I have solved this issue, I cannot do the assign parameters.

Any suggestions?

See these topics:

Thank you!

You’re welcome!

Is there a straightforward method to import the file name of a unique Excel file ?

It seems there is no option when I use the Import File > Import Excel Spreadsheet

It’s possible when using Import Multiple Files > Import Excel Spreadsheet… if I click the box at the bottom of the window (include column with file path in the results)


Hi Michel,

if you need to add a column with file name for 1 file you need to use the multiple-file load mode to load only a single file.