Pass value of field with parameter as export file name

I still struggle with parameters. I understand that they are immutable, but it’s the connection between a field that I have that contains data I want to pass into the file name and the parameter that contains the majority of the destination path except for the file name which would change each time the job runs.

For example, I have this derived table deduped down to the pay period name that needs to be in the file name

The same derived data is aggregated and exported to an Excel sheet

The path is a parameter

image

So the export file name needs to be a combination of the pay period name field and parameter based path.

I think that the answer is going to be something with moving the export part of the project to a new module then iterating that pay period column into a parameter in the new module. But concept really breaks my brain because while the pay period changes once every 2 weeks, it’s immutable for this run only.

You can calculate the file path in a column, for instance, something like below:

combinepath({vRollupPath}, [PayPeriodName])

Then append this column to the main dataset using the "Peek" action.

Finally, use the "First column value" option to use the first value of the specified column as the output file path.

The downside of this approach is that the output Excel file will have a column with the file path.

The "First column value" option sometimes helps avoid creating a separate module just for one iteration.

Also, you can use the "Iterate table" action in the 'PayPeriod Name" table. It will require creating a module with one "Input" action that will be used to pass the main table "Pay Period Data" into that module, which then can be immediately saved into a file in that module. So basically, iterating with just 1 iteration.

Thanks Dmitry, that is a great way to do it with minimal trade off.

What I ended up doing in the meantime was Call with Another table

Then the settings for that action were:

The called module used Input action, then I ran my other actions and exported

image

the pay period range is passed appropriately as a string into the parameter and is used in the construction of the destination file name

1 Like

That's a good approach. The "Call with another table" action is the right choice here. Thanks for the heads up!