How to allow a file_path parameter to be selected by browsing folders instead of typing?

Highlighted
Five Stars

How to allow a file_path parameter to be selected by browsing folders instead of typing?

Hi,

 

I have made a processor component which takes a file path as an inputtalend_input.png

 

I have defined it as a String parameter now:

@Option
@Documentation("TODO fill the documentation for this parameter")
private String input_path;

How can I make this parameter input the path by browsing they file system, like in the case of a tFileInput* component:

talend_tfid.png

the "File name/ Stream" parameter.

 

I tried declaring the parameter under

@Option("file-path"

which I saw briefly mentioned in the documentation, and changed the parameter type to "File", but it didn't change anything. I can't find any documentation on how to do this though. What should I change to get this done?

 

Thanks,

Siva

Moderator

Re: How to allow a file_path parameter to be selected by browsing folders instead of typing?

Hello,

You could define a context variable and assign a default file path to it, set the File name/stream field of tfileInputExcel in context variable like:

contextfile.png

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Moderator

Re: How to allow a file_path parameter to be selected by browsing folders instead of typing?

Hello,

If your input file changes frequently and you cannot define in context variable as I said.

Please use tFileList component to iterate all the files that matches the file mark you define.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How to allow a file_path parameter to be selected by browsing folders instead of typing?

Hi,

My question is regarding a custom component that I have created. That's why I had posted in Component Development board.

 

I want to know how to input a file directly by browsing and selecting it from the computer. Currently I am taking the file path as an input (String type) and then reading the file.

 

Thank You.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog