Skip to main content
Solved

Get value from index +1

  • May 15, 2025
  • 2 replies
  • 42 views

clowncutie
Contributor
Forum|alt.badge.img+7

I have 7 features, which each represents a route with unique trip_id.

 

Each of these features have a list, containing buss_stop_id along the route and element index, as well as next sequence value. I want to add, either in the list or in the features after list exploder, the value for the buss_stop_id for the next one. I played around with list builder and exploader for a long time and cant figure it out. Tried some ugly solution @Value(_list{@Value(_list{0}.next_sequence)}.buss_stop_id) but did not worka s intended

 

So in my example I want the end result to be something like next_buss_stop_id an attribute in _list{1} which is the buss_stop_id from _list{2}

Meaning _list{2} = buss_stop_id = 363, next_buss_stop_id 364

Best answer by hkingsbury

One approach would be exploding the list out so each element is its own feature. Then in an AttributeManager or AttributeCreator enable Adjacent Feature Attributes (under Advanced). 

This will allow you to look at the next feature and use those values to populate the current one. Note that this will need to be in conditional logic (checking that the next features attribute has a value) so the last feature isn’t trying to reference data that doesn’t exist.

https://fme.safe.com/blog/2017/08/adjacentfeatureattributes-evangelist166/

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+64
  • Celebrity
  • Best Answer
  • May 15, 2025

One approach would be exploding the list out so each element is its own feature. Then in an AttributeManager or AttributeCreator enable Adjacent Feature Attributes (under Advanced). 

This will allow you to look at the next feature and use those values to populate the current one. Note that this will need to be in conditional logic (checking that the next features attribute has a value) so the last feature isn’t trying to reference data that doesn’t exist.

https://fme.safe.com/blog/2017/08/adjacentfeatureattributes-evangelist166/


clowncutie
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • May 23, 2025
I

Im almost a bit angry that the solution was there all along :D atleast I got really good at learning lists.