I’m trying to figure out how to use the numeric value of a string item (this is the output of a text parser module) to select an item from a bundle with the same value position within the bundle.
For example if the string item has a value of ‘2’ I’d like to forward the second item from a bundle to another module.
As far as I can see I need to know how to:
convert a string value to an integer,
use the numeric value of an item to select a sub item from a bundle.
Picks elements with the given keys from a collection. Returns a collection that contains only the picked elements. Useful when you want to pass a collection to an API, which expects an exact number of elements in the collection. Using this function, you can make sure your collection meets the requirements of the API.
Also might be worth mentioning that all I need returning is the string value of the array item, it doesn’t need to be in an particular container type like a collection
Your data structure is not clear through this thread. Please download the output bundle from JSON module you are trying to map data from and drop in this thread. It will help makers to provide you the solution.
Glad to hear that you figured out on your own. Also you can group by using the variable names in array aggregator, that will produce different bundles in aggregator output and you can easily access using get and map function then.
Your array has a set of indices (that’s the number 1 when you look at the first element, number 2 for the second and so on).
So to access the first element of an array first(<arrayname>) will grab the first element for you. And then you can use pick() on that element which will just be a collection. It’s really important to understand what each function needs as input to properly function and experimentation with them using your structure will help you.
Can I suggest you take a look at the Make for Make Newbies video series? It will really help you out by studying various ways to manipulate data structures in Make.