About EasyMorph Tutorials & Examples Web-help

Problems understanding List of Files with iterations

Dear Dmitry,

unfortunately I have some problems understanding the “List of Files” and Iterations-Concept.

What do I need to achive:
I have a folder to which regularly I got an .xlsx file with a name like BLZ_YYYYMMDD.xlsx. The timestamp included in the filename is the validity from date of the file. I need to select always the latest file (highest date). With this file I need to perform a couple of transformations.

What I have done so far in EasyMorph:
I starteted in building up the needed transformations; first I selected the file to load manually > You will find als this in the “Main”-Module of the attached project.

Then I started to “develop” the list of file part in a second module “Load actual file”. Got all filters right so that always the latest file is residing in the list of files.

What does not work so far:
1) I could not get the iterations running. Keep getting an error that the parameter is empty/missing.

Note: Just by tipping this posting together and still fiddling around with the project I managed to get the iteration working; so everything marked in italics seems to be solved for now. Don`t know what I have done to get it working…

What is missing additionally:
2) I would need an YYMMDD string transformed from the file names timestamp from the Module “Load actual file” to include it in column “last_version” in the table “Ladeformat_BLZVZ” in Module “Main”.

Best regards,
Patrick

BLZVZ2.morph (13.6 KB) BLZ_20200608.xlsx (1.3 MB) BLZ_20200608.xlsx (1.3 MB) BLZ_20200608.xlsx (1.3 MB)

In the meantime I thought that I managed to get everything working:
I just had changed names of parameters so that they where not the same in both modules.

Then I selected Reload and Run and everything seems to have worked correctly.

Then I changed the .xlsx-files in the sources folder (deleted some of them) and unfortunately it doesn`t work again.

It seems that the parameter values do not change / are not updated:
2020-07-28_180541

Best regards,
Patrick

Hello Patrick,

When you run a module on its own, it always uses parameter values that are specified in the “Parameters” tab or the “Edit parameters” dialog.

The “Iterate” action doesn’t modify parameter values, stored with a called module. It merges parameter values, specified in the action properties, with parameter values, stored in the called module. And executes the module with the merged set of parameters.

The only way to see parameter values which were actually used to execute a called module it to make that module fail and then press “Open module” button in the error card:
image

As for the question about the “last_version” value - you can you the following function instead of the one that you are using currently:
format(date({File validity from as string},"yyyyMMdd"), "yyMMdd")

1 Like

Dear Andrew,

thank for your help.

May I suggest a feature request to change / improve this behavior:
From my perspective it should be possible to test a complete true-running circle inside the client before deploying to the EasyMorph-Server / real world. At least this is the way I´m currently working on such processes: Build them - part after part - together and then do a manual “test-run” (mostly inside the client) before deploying them to “the real world” / automation service.

Best regards,
Patrick

To learn more about EasyMorph visit easymorph.com.