Hello @nielsgerrits,
Â
This negative list element is currently not implemented into FME. However, there is an idea that has been posted. If you want to head over and post a comment/upvote that will give it more standing with developers when they go to add new features.
The idea can be found here: https://knowledge.safe.com/idea/37432/reverse-list-element-selection.html
import fme
import fmeobjects
def processFeature(feature):
    list = feature.getAttribute('_testList{}.testattribute')
    print list -1]
Â
In those cases, I think it is easy to work with a pythoncaller.
I have added a small sample workspace that builds a simple list attribute. The pythoncaller is used to extract this list attribute into a new python list variable (see code above). There it is possible to use negative indices.
This is just a simple example to show you this is possible. ;)Â
Hello @nielsgerrits,
Â
This negative list element is currently not implemented into FME. However, there is an idea that has been posted. If you want to head over and post a comment/upvote that will give it more standing with developers when they go to add new features.
The idea can be found here: https://knowledge.safe.com/idea/37432/reverse-list-element-selection.html
Heya @trentatsafe,
Â
Thanks for pointing out, I should have searched the Ideas as well before posting this question.
Â
import fme
import fmeobjects
def processFeature(feature):
    list = feature.getAttribute('_testList{}.testattribute')
    print list -1]
Â
In those cases, I think it is easy to work with a pythoncaller.
I have added a small sample workspace that builds a simple list attribute. The pythoncaller is used to extract this list attribute into a new python list variable (see code above). There it is possible to use negative indices.
This is just a simple example to show you this is possible. ;)Â
Heya @jneujens,
Â
Thanks for the working example!
Â