Skip to main content

Hi all,

I am looking for a transformer that does the opposite of the ListKeyValuePairExtractor.

It needs to create a list with FIELD_NAME and FIELD_VALUE pairs for all the attributes on a feature.

I checked the transformer gallery and the FME Hub, but could not find such a transformer.

Has anybody a solution?

Could be a Python script.

 

Thanks in advance.

Erik

Hello @erik_jan 

If you are looking for a transformer that can create a list structured like:

_list{0}.FIELD_NAME = "Field 1"
_list{0}.FIELD_VALUE = "Value 1"
_list{1}.FIELD_NAME = "Field 2"
_list{1}.FIELD_VALUE = "Value 2"

Try the AttributeExploder with the Exploding Type parameter to ‘List’. You should be able to select the name of the output list as well as the name of the exploded attribute and value in the Output Attribute Names parameter section.

If you are looking to create a list that looks like:

_list{0}.FIELD1 = "Value 1"
_list{0}.FIELD2 = "Value 2"

Then try the ListBuilder.


Thanks @debbiatsafe ,

That worked perfectly.

Exactly what I needed.

Erik


Reply