Skip to main content

Hi,

I am using FME Desktop 2017 and would like to know if there is a way to get a list that I have generated in my FME Workflow, into the PythonCaller, in a similar way to how you use 'getAttribute' function feature.getAttribute(x) to get a normal attribute into the PythonCaller.

Thank you for your help in advance.

For simple and compound lists you can just use

 

 

feature.getAttribute('list{}') or feature.getAttribute('list{}.x')

 

 

For nested lists you need to loop through the parent list to get the sublists.


Hi @aquamarine,

I created a Workspace that show the print values from a List ( _list{}.names ) in Log file using the PythonCaller:

Thanks,

Danilo


For simple and compound lists you can just use

 

 

feature.getAttribute('list{}') or feature.getAttribute('list{}.x')

 

 

For nested lists you need to loop through the parent list to get the sublists.

That's exactly what I needed!

 

Thank you @jdh

 


Hi @aquamarine,

I created a Workspace that show the print values from a List ( _list{}.names ) in Log file using the PythonCaller:

Thanks,

Danilo

Hi all

 

I am getting from Excel a column called Name,

 

after I built lists with Listbuilder ,

 

but I have an error in my pythoncaller,

 

please provide some feedback

 

 


Hi all

 

I am getting from Excel a column called Name,

 

after I built lists with Listbuilder ,

 

but I have an error in my pythoncaller,

 

please provide some feedback

 

 

If you inspect the features prior to the PythonCaller, does every feature have a value for _list{0}.Name?

 

 

You can try adding "if Nombres:" just prior to the for loop, so that there is no python exception if there list doesn't exist.

 

 

 


If you inspect the features prior to the PythonCaller, does every feature have a value for _list{0}.Name?

 

 

You can try adding "if Nombres:" just prior to the for loop, so that there is no python exception if there list doesn't exist.

 

 

 

 

Yes, the list has many values , I dont know is I can iterate the object..

 

@takashi , @david_r , @danilo_fme , @takashi

 

I am using FME 2016.1


 

Yes, the list has many values , I dont know is I can iterate the object..

 

@takashi , @david_r , @danilo_fme , @takashi

 

I am using FME 2016.1

There seems to be some white space at the end of the _list{}.Name attribute.

 

 


Reply