In projects I need to generate many tables that do compare large sets of data, then export the calculated diff items from the table to files. Export logic and actions are always the same: skip on condition (if table is empty), then apply some actions, then export to delimited text file or whatever, with name of the file being the name of the “diff” table I want to export.
Thus, I would like to create a kinda generic module / project that would take care of exporting file. Rather than always duplicating the very same actions and then update dozens of actions if i do change anything in my export workflow (file naming, whatever), I could build some “util” that just needs to be used with a Call module/project action.
However, I cannot find out how to pass the calling table name as parameter to my module so that i can use this paramater dynamically to build the file name. Or maybe there is another way to achieve my goal ?
The “Table metadata” action mentioned by @bolud could’ve helped but it replaces the current dataset. It looks like, we need to add an option to append columns with metadata to the current dataset.
Meanwhile, you can explicitly pass the table name as a parameter to the called module.
FYI I also tried to pass a calculated parameter using metadata(‘current table’) to the module, but it’s not evaluated and is always empty. Normal, as I guess parameters are evaluated on project opening and not real-time.
I did also think about using shared memory, but I guess I would then need to chain all my tables to avoid synchronization issues and make sure that the right data is always remembered / recalled without overriding between processes.
The idea is to have generic modules, always performing the same actions on some tables, e.g. get a file in csv and “convert” to .dset after some repetitive cleaning or save a file after some conditions checking, etc. to avoid always repeating the same actions in my workflow tables. And I need to be “table name” based in the output naming.
I tried to use a calculated parameter in my main module that would calculate the name of the table by using metadata(‘current table’) function. But (as expected I guess ;-)) it always evaluates to empty.
Thanks @dgudkov. I will go with the second option.
However, I think that providing in the future the ability to use this “table name as it was before entering the module” would be super useful to implement generic modules such as the ones I described Easy and much more autmated loading / cleaning / saving to other formats of “similar” datsources and so on.
I will continue digging and btw, EasyMorph is a superb ETL !