Using Input Port in File List Component

120 Views Asked by At

I'm trying to pass a parameter into the File List component through input port 0. All of my attempts thus far have been met with an error,

Input edge has no effect. Disconnect edge or use metadata fields as parameters in Target URL, Source path or Target path.

Ideally, I would like the Target URL to be something along the lines of http://${S3_ACCESS_KEY}:${S3_SECRET_KEY}@${MY_BUCKET}.s3.amazonaws.com/reports/${port:0.value}/*_interestingReport.csv where ${port:0.value} is the value passed in from the input port.

What is the correct way to use data coming in on input port 0?

2

There are 2 best solutions below

1
On BEST ANSWER

The way how passing parameters from input edge for File List (but other file components as well) works, is that you use the name of the metadata column from an input edge and enclose it between ${ and }.

So if the metadata on the edge have a field called directory, which contains the dir you want to use, this is the way how to do it.


http://${S3_ACCESS_KEY}:${S3_SECRET_KEY}@${MY_BUCKET}.s3.amazonaws.com/reports/${directory}/*_interestingReport.csv
0
On

Let me show you an example of a very simple graph which uses a 'Data Generator' that creates the flow and sends it as the input of a 'File List' component'.

http://www.filedropper.com/inputportfilelist_1

As you can see the way the input field is referenced is '${DATA_SOURCE_DIR}/${fileDir}/', being 'fileDir' the only field contained in the metadata of the link that connects both components. It'll basically list the files located in ${PROJECT}\data\source\manifests.

I hope this helps.