# The Get Variable block The Get Variable block The **Get Variable** block retrieves the value of any variable defined by a [**Create Variable**](/docs/postman-flows/reference/blocks/create-variable/) block anywhere in the flow. The **Get Variable** block then sends that value from its output port. ## Output **Select a variable** - When a variable is selected, this port sends the variable's value. ## Setup You can add a **Get Variable** block directly to the canvas, or insert it inline within any block that takes variables as input. See [Related blocks](#related-blocks). Select **Select a variable** and choose a variable from the dropdown list. The list is populated with variables created by **Create Variable** blocks in the flow. A pin icon appears in any **Get Variable** block that you insert inline into a block that's within a loop. To learn how variable pinning works, see [Loops with external data](/docs/postman-flows/build-flows/structure/loops/loops-external-data/). ## Example To see the **Get Variable** block in an example flow, check out [Flow Snippets: Variables](https://www.postman.com/postman/flows-snippets/flow/63bc94d282cf9728f279e020). ## Related blocks Any value that the **Get Variable** block can retrieve must first be defined by a [**Create Variable**](/docs/postman-flows/reference/blocks/create-variable/) block somewhere in the canvas. Numerous blocks allow you to [insert](/docs/postman-flows/reference/blocks/overview/#insert-data-blocks-into-other-blocks) the **Get Variable** block inline, including the [**Create with AI**](/docs/postman-flows/reference/blocks/create-with-ai/), [**Evaluate**](/docs/postman-flows/reference/blocks/evaluate/), [**If**](/docs/postman-flows/reference/blocks/if/), [**List**](/docs/postman-flows/reference/blocks/list/), [**Record**](/docs/postman-flows/reference/blocks/record/), and [**Template**](/docs/postman-flows/reference/blocks/template/) blocks. ## Related pages For tutorials that use the **Get Variable** block, see the following: * [Automate repetitive tasks using Postman Flows](/docs/postman-flows/tutorials/advanced/automate-repetitive-tasks/) * [Calculate the years since a milestone](/docs/postman-flows/tutorials/beginner/calculate-years-since-milestone/)