Help dealing with multiple responses from API in to Variables

Hi there, I have no issue calling an API and getting a single result to map to a variable. But how do I handle the case where the API returns multiple results and I want Alexa to utilize all the results?

For example, user can search for food categories from a food database. Their input is “vegetables” (which is mapped to a variable using CAPTURE block), so an api call is made that searches for vegetables, something like https://example.com/api/search?type={UserInput}

"response":[
0:{
"name":"carrot"
"type":"vegetables"
}
1:{
"name":"pea"
"type":"vegetables"
}

Now I have these results mapped to variables in this fashion:
response.0.name --> {vegresult}

This obviously only captures the first result…how do I go about capturing subsequent results without having to create a separate variable mapping for each? I mean if this had 20 results I assume there’s a better way to handle it that:
response.0.name --> {vegresult}
response.1.name --> {vegresult1}
response.2.name --> {vegresult2}
etc…

Sorry…probably a very beginner question :slight_smile:

Hi! It can be done with the help of the Code block.
This is what we are doing for the RSS feeds in this tutorial: Using a RSS feed to make a Podcast Skill

Thanks, I’ll take a look.