For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
        • Overview
        • Use TypeScript in an Evaluate block
        • Iterate through a list using a For loop
        • Select data from complex JSON
        • Persist data outside a flow
        • Use the AI Agent block as logic for a flow
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • Recipe
  • Try it out
  • Related pages
Postman FlowsFlows cookbook

Iterate through a list using a For loop

||View as Markdown|
Was this page helpful?
Previous

Use TypeScript in an Evaluate block

Next

Select data from a complex JSON response

Built with

A common Flows design pattern involves getting a response from a request that returns a list, then processing each item in the list. You can do this by constructing a loop with a For block. A For block requires an array as its input. Blocks such as List, Get Variable, Evaluate, and Select can return an array, but the response from an HTTP Request block typically doesn’t. You can use TypeScript in an Evaluate block to transform a response into an array.

Recipe

The following recipe shows how to use an Evaluate block to manipulate the response from an HTTP Request to create an array:

  1. Create a flow and add an HTTP Request block.

  2. In the HTTP Request block, create a GET request with the following URL:

    1https://openlibrary.org/subjects/love.json?limit=5

    This gets a list of five book titles, along with other response data.

  3. Connect an Evaluate block to the HTTP Request block’s Success port. Rename the value1 input items, then click its Enter path… field and add an inline Select block. Set the Select block’s path to body.works.

  4. To make an array from the selected part of the previous block’s response, enter this code in the Evaluate block:

    1items.map((work: any) => work.title)

    This creates an array of the book titles.

  5. Connect a For block’s List port to the Evaluate block’s Result port.

  6. Connect an Evaluate block to the For block’s Item port and rename the value1 input item. Then enter this code:

    1item.toUpperCase()

    This capitalizes all the letters in the titles.

  7. Connect a Collect block to the Evaluate block’s Result port. This will put the capitalized items back into a list.

Try it out

To see this recipe’s completed flow, check out Cookbook: Iterate through a list using a For loop. You can also clone this flow to your workspace to experiment with it.

Related pages

This recipe shows one example of how to make a loop in Flows. For more examples, see the following:

  • Loops overview
  • Break out of a loop in Flows
  • Loops with external data