# Get value from homeyscript in a variable that can be used in advanced flow

**URL:** <https://community.homey.app/t/get-value-from-homeyscript-in-a-variable-that-can-be-used-in-advanced-flow/107990>\
**Category:** Questions & Help\
**Tags:** homeyscript, advancedflow\
**Created:** [April 10, 2024, 2:31pm UTC](https://community.homey.app/t/get-value-from-homeyscript-in-a-variable-that-can-be-used-in-advanced-flow/107990 "2024-04-10T14:31:55Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 16, 2024, 11:20am UTC](https://community.homey.app/t/get-value-from-homeyscript-in-a-variable-that-can-be-used-in-advanced-flow/107990/13 "2024-05-16T11:20:41Z")

</div>

> [@Pairis](#):
>
> ```auto
> const liveweer = data.liveweer[0];
> console.log(`Location: ${liveweer.plaats}`);
> 
> ```

I think this is about the same issue you replied to some years ago, Robert: wanting to get certain values from returned JSON data from weerlive.nl

Your post below in English:

- `$` represents the (JSON) object returned by the server
- `liveweer` is the name of a “key” in that object; the value associated with the key is an array of values (each value is another object, so `$.liveweer` is an array-of-objects)
- `[0]` is the first element of that array; if you want the second element, you have to use `[1]` (etc);
- `d0tmax` is the name of a key in the (in this case) first element of the `liveweer` array

The expression is a JSONPath expression. You can [here](https://jsonpath.com/) try such expressions in real time: paste the JSON result from the weerlive server into the “JSON” field, enter the JSONPath expression at the top, and on the right you can see the result.

Original Dutch post:

> [@Weerlive.nl](https://community.homey.app/t/weerlive-nl/16016/8):
>
> - `$` representeert het (JSON) object dat teruggestuurd wordt door de server
> - `liveweer` is de naam van een “key” in dat object; de waarde die bij de key hoort is een array van waarden (elke waarde is weer een object, dus `$.liveweer` is een array-van-objecten);
> - `[0]` is het eerste element van dat array; als je het tweede element wilt, moet je `[1]` gebruiken (enz);
> - `d0tmax` is de naam van een key in het (in dit geval) eerste element van de `liveweer` array
> 
> De expressie is een JSONPath expressie. Je kunt [hier](https://jsonpath.com/) in realtime zulke expressies uitproberen: plak het JSON resultaat van de weerlive server in het “JSON” veld, vul bovenin de JSONPath expressie in, en rechts zie je het resultaat.

---

_[View the full topic](https://community.homey.app/t/get-value-from-homeyscript-in-a-variable-that-can-be-used-in-advanced-flow/107990)._
