# Loop through all orders of a ticket

**URL:** <https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502>\
**Category:** V4 Question\
**Created:** [February 10, 2014, 11:58am UTC](https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502 "2014-02-10T11:58:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrigu3014](https://forum.sambapos.com/user_avatar/forum.sambapos.com/chrigu3014/32/39083_2.png) [@chrigu3014](https://forum.sambapos.com/u/chrigu3014)\
**Post date:** [February 10, 2014, 11:58am UTC](https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502/1 "2014-02-10T11:58:08Z")

</div>

Hi, I want to loop through all orders of a ticket and update order tags, can it be done? How?

So far I’ve tried:

Create Automation Command ‘x’  
Rule [Automation command executed] calls action of type Loop Values named ‘y’, value is {:ORDERS}  
Rule [value Looped] calls action update orders.

I’ve been trying for hours and cannot get it to run.

---

<div class="post-metadata">

**Author:** ![JohnS](https://forum.sambapos.com/user_avatar/forum.sambapos.com/johns/32/24916_2.png) [@JohnS](https://forum.sambapos.com/u/JohnS)\
**Post date:** [February 10, 2014, 12:15pm UTC](https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502/2 "2014-02-10T12:15:03Z")

</div>

I am fairly sure that can not be done. You need to select all of the orders first to apply an Update Order Tag. Looping is used for processing multiple tickets, not orders.

Can you describe your situation so we have a clearer picture of what you need to achieve.

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [February 10, 2014, 12:15pm UTC](https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502/3 "2014-02-10T12:15:59Z")

</div>

You don’t need to loop to update order tags. Update Order Tag action automatically loops all orders. If you can give more details about your case I can give better advice.

---

<div class="post-metadata">

**Author:** ![chrigu3014](https://forum.sambapos.com/user_avatar/forum.sambapos.com/chrigu3014/32/39083_2.png) [@chrigu3014](https://forum.sambapos.com/u/chrigu3014)\
**Post date:** [February 10, 2014, 1:05pm UTC](https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502/4 "2014-02-10T13:05:44Z")

</div>

From the ticket screen I want to create a button that tags all orders with a certain order Tag (Take Away).

---

<div class="post-metadata">

**Author:** ![chrigu3014](https://forum.sambapos.com/user_avatar/forum.sambapos.com/chrigu3014/32/39083_2.png) [@chrigu3014](https://forum.sambapos.com/u/chrigu3014)\
**Post date:** [February 10, 2014, 1:09pm UTC](https://forum.sambapos.com/t/loop-through-all-orders-of-a-ticket/502/5 "2014-02-10T13:09:37Z")

</div>

Works, i’ve looked too far…  
Thanks a lot!
