Skip to main content

Hi,

I want to create a custom transformer that concatenates the elements of a list entered as a parameter. This list is like: elements {0}, elements {1}, elements {2}... elements{x} and contains words. The start index is also an input parameter. As the number of items in the list varies, I created a loop where I get the index of each item.

My problem: my list $(_ list) is a parameter and I don't know how to call its elements to add them to the string I want to build.

Can you help me?

Nicolas

Hi @dhaulagiri​ 

I think the transformer ListConcatenator can be helpful for you.

Did you try to use it?

 

Thanks in Advance,

Danilo

 


Thank you @danilo_fme​ 

I looked at this transformer but I think it necessarily concatenates all the elements of a list. I must choose the starting index, because depending on the results of the previous treatments, I have to keep all or delete the first, the first two or the first three elements...


Hi @dhaulagiri​ 

Thanks your feedback.

The custom transformer ListSlicer can be help for you.

It's possible to start a index and after create a string ( concatenated process ).

I published the parameter for start index and used before the transformer ListElementCounter ( to get the number of list element generated ).

ListSlicerAttached the Workspace.

 

Thanks in Advance,

Danilo


 Thanks @danilo_fme​ , this is exactly what I need! I hadn't seen this transformer at all.

But if this solution solves my problem, it doesn't answer my question: I would like to know how to refer to an element of a list passed as a parameter. It might help me one day or another. Anyone know?


Reply