Save variables for filenames

When using the “List of Files” and getting the filename with path and filename, I pass this to “Import delimited text file” to load the CSV file. Issue I’m having is at this point I want to make some changes to the imported data and export it to google docs. Google docs requires a File name and I want to unse the original file name that was pulled from the import.

What’s the best way? Do you have a sample?

Thanks
Flowy

Put loading the CSV file and export to Google Docs into a separate module which has a parameter for the file name. Assign the parameter in the “Call” action that calls the module.

See this tutorial article in modules: EasyMorph | Subroutines

The issue I’m having is assigning the variable in the Call action. Do you have a sample on the usage of passing it in the call? I basically tried to set up a module that just grabs the “Filename”. I had the mode set to “Do not return result table” but I’m assuming I’m to use the Parameter in FileName = This project. How do I set up the parameter here? In the 2nd module, is that where you use the Edit parameter? And if so how does it pass?

Let me paste the pictures of what I did.
FileNameError1.png shows how the 2nd module looks like. One column named “Filenameonly” with the filename.

I added a Edit parameter within the 2nd module. Looks lke FileNameError2.png. This is where I think I’m missing how to pass it? Or do I not use this?

Then in module 1 where I morph my loaded file and am ready to load into google sheets, I have it set up like FileNameError3.png. So the Module to run is Module 2 named “FileName”. If I say return table, I get the table back but it wipes out my morphed table I was going to upload to GoogleSheets. I was trying to assign the parameter so Test was what I called it in the 2nd module as seen in the second picture.

Then I named the This project as TestNew hoping I could use in the google docs path as seen in picture 4.


FileNameError1
FileNameError3
FileNameError4

Thanks
Flowy

No need to put field names like [TestNew] as parameter values. It doesn’t work like that. In the called module, use some parameter values for testing the module logic.

The default parameter value in the called module gets overwritten by the “Call” action when the module is called in a workflow. However, when you look at the module, the parameter value is the same (i.e. not changed). That’s because technically, under the hood, the “Call” action runs a clone of the module, assigns the parameters of the clone, and executes the clone. Using a module clone under the hood is necessary to avoid conflicts when the same module is called simultaneously.

Here is a working example of using the “Call” action:
call-demo.morph (4.9 KB)

It creates a file called dir.txt with a list of files in the directory where the project is placed.