Skip to main content
Solved

Extract values from dynamically changing indices from a list

  • January 15, 2018
  • 3 replies
  • 160 views

Forum|alt.badge.img

Hi all,

I try to dynamically read values from a list, i.e. sometimes I need to extract the value at index 0, sometimes the value at index 5 and so on and then store the value to a new attribute. The index of the value I need to extract depends on the value of another attribute. The number of entries in the list is roughly limited to 10 in my use case, so I solved this problem with a conditional value in the AttributeManager. However, it'd be nice to know if there's a dynamic solution to this problem.

Best answer by david_r

In addition to the solution proposed by @redgeographics, you can also use the ListIndexer transformer.

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.

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+62

Yes, you can enter an attribute for the list index like this:


david_r
Celebrity
  • Best Answer
  • January 15, 2018

In addition to the solution proposed by @redgeographics, you can also use the ListIndexer transformer.


Forum|alt.badge.img
  • Author
  • January 15, 2018

Thanks, both solutions work very well!