# Homey script best practice: how to return multiple results to the flow?

**URL:** <https://community.homey.app/t/homey-script-best-practice-how-to-return-multiple-results-to-the-flow/94590>\
**Category:** Developers\
**Created:** [November 14, 2023, 1:07pm UTC](https://community.homey.app/t/homey-script-best-practice-how-to-return-multiple-results-to-the-flow/94590 "2023-11-14T13:07:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [November 14, 2023, 1:07pm UTC](https://community.homey.app/t/homey-script-best-practice-how-to-return-multiple-results-to-the-flow/94590/1 "2023-11-14T13:07:14Z")

</div>

What is the most elegant way to return multiple results from a Homey script back to the flow? I was thinking something similar to flow tokens. Yeah, I know I could return a JSON and then parse that multiple times to get the individual results, but that’s not my definition of “elegant” 😉

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 14, 2023, 2:06pm UTC](https://community.homey.app/t/homey-script-best-practice-how-to-return-multiple-results-to-the-flow/94590/2 "2023-11-14T14:06:49Z")

</div>

If you use the JSON handler app you only need one card for parsing 😉

---

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [November 15, 2023, 11:53am UTC](https://community.homey.app/t/homey-script-best-practice-how-to-return-multiple-results-to-the-flow/94590/3 "2023-11-15T11:53:29Z")

</div>

I guess I gave myself the answer to that question: use flow tokens. Just use

```auto
await tag(<name>,<value>);

```

at the end of your Homey script to return as many flow tokens as necessary with name and value. You just need to run the script once in order for the token to show up in the selection in the flow editor.
