Skip to main content

Hello,

i am facing the following task. csv-files that have different headers (different columns) are to be processed. In other words, file1 has a set of attributes, file2 has a different set of attributes, etc. In a Python start up script, the different columns are determined whenever the workbench is started.

 Now i would like to use these attributes within published parameters. The idea:

A published parameter “p_city” asks for the column which corresponds to “p_city” (name of the city). The user can select among the columns that have previously been determined by the start up script.

How can i pass the determined columns from the start up script to a fme parameter? Or do you have a better idea?

Best wishes 

I think a better approach may be the Scripted parameter type. As far as I know, the value from the Startup Python script can not be passed to a user parameter. Values of the parameters are established at runtime.

 


@dustin, thanks a lot for your reply. I have progressed a little bit. Using a pythoncaller I can now determine the header attributes as a semicolon separated string. By means of an attributesplitter I can now create a list containing the individual items. My idea now is to use these list to “somehow” create a user parameter “choice” out of it.

However, this posts 

User choice parameter using read data as choices | Community (safe.com)

says that it is not possible to create a user parameter at run-time. At least I understand it like this. Takashis workaround is smart, but a bit too smart for me :-)

I will try to find a solution using a lookup table.

Thanks again for your support anyway!

 


Reply