# Setting up simple GET request and storing value as numeric logic object

**URL:** <https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614>\
**Category:** Questions & Help\
**Tags:** tools, flow\
**Created:** [June 20, 2021, 11:46am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614 "2021-06-20T11:46:20Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [November 1, 2022, 8:26am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/21 "2022-11-01T08:26:41Z")

</div>

That is too bad. I’m working around the HTTP Requests app, as it doesn’t look like it will be updatet to SDKv3. The developer hasn’t provided any contact information, and there is no topic available.

I’m looking to do the same thing with Homey’s own logic in advanced flow. But I get stuck at the header and body of the HTTP request.

 ![Scherm­afbeelding 2022-11-01 om 09.27.39](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/32bb3cde0266dee3a71340ee48e39e37858a5df5.png)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [November 1, 2022, 8:33am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/22 "2022-11-01T08:33:33Z")

</div>

Perhaps just `{}`?

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [November 1, 2022, 8:39am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/23 "2022-11-01T08:39:40Z")

</div>

You used the wrong request card, you need the one with the tag icon behind it’s title (just below it in the list).

The headers and body inputs are optional and can be kept empty.

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [November 1, 2022, 10:02am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/24 "2022-11-01T10:02:03Z")

</div>

Thanks for your help, the flow now continues. But the variable is not set. Am I missing something else?

 ![Scherm­afbeelding 2022-11-01 om 11.01.27](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/0/d056549c838d56c2a30be1b2d65c3477c32b7f70.png)

```auto
{"embedded": null, "links": {"_self": {"deprecation": null, "href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/1566c497a5655686153316861545651784d7a41344d6a456a497a6b3459544532597a59794f44686a4e32517a4d54686c4d6a52685a474d7759574e6c5a54646c4e5746685a4751794e32526d4e4759304f5745354e6d566b596a686d5a6a466d5a4445314e5455314d5445794e54513d/status", "hreflang": null, "name": null, "profile": null, "templated": null, "title": null, "type": null}, "vehicle": null}, "battery": {"current": 0.0, "voltage": 97.5}, "doors_state": null, "energy": [{"updated_at": "2022-11-01 07:44:53+00:00", "autonomy": 330.0, "battery": null, "charging": {"charging_mode": "No", "charging_rate": 0, "next_delayed_time": "PT7H45M", "plugged": true, "remaining_time": "PT0S", "status": "Stopped"}, "consumption": null, "level": 97.0, "residual": null, "type": "Electric"}], "environment": null, "ignition": null, "kinetic": {"acceleration": null, "moving": null, "pace": null, "speed": null}, "last_position": {"type": "Feature", "geometry": {"coordinates": [null, null, null], "type": "Point"}, "properties": {"heading": null, "signal_quality": null, "type": null, "updated_at": null}}, "preconditionning": {"air_conditioning": {"failure_cause": null, "programs": [{"enabled": false, "slot": 1, "recurrence": "Daily", "start": "PT12H", "occurence": {"day": ["Mon"]}}], "status": "Disabled", "updated_at": "2022-11-01 07:44:52+00:00"}}, "privacy": {"state": "None"}, "safety": null, "service": {"type": "Electric", "updated_at": "2022-10-20 20:30:13+00:00"}, "timed_odometer": {"updated_at": null, "mileage": 16424.2}}

```

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [November 1, 2022, 10:49am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/25 "2022-11-01T10:49:25Z")

</div>

Your using jQuery (I think) as path, Homey uses javascript, so should be `energy[0].level`  
Little bit difficult to double check everything in your card on mobile.

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [November 1, 2022, 11:03am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/26 "2022-11-01T11:03:14Z")

</div>

Sadly, that also didn’t work. The variable doesn’t change, while the flow continues. I have no clue about jQuery and javascript when I have to type it myself. When I read it, I can understand it. Does anyone have another suggestion? Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)\
**Post date:** [November 1, 2022, 11:04am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/27 "2022-11-01T11:04:49Z")

</div>

How are you checking that the variable (not) changed?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [November 1, 2022, 11:08am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/28 "2022-11-01T11:08:23Z")

</div>

> [@Caseda](#):
>
> Your using jQuery (I think)

JSONPath.

---

<div class="post-metadata">

**Author:** ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)\
**Post date:** [November 1, 2022, 11:09am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/29 "2022-11-01T11:09:33Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/8/8847993f7802c5477ec96e26452288c42279509a.png)

The card returns a new token with the updated JSON. The old token is not updated/mutated.

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [November 1, 2022, 12:32pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/30 "2022-11-01T12:32:19Z")

</div>

I checked my logic in Homey.  
I don’t understand why your “to”-value is 1337. It should return 97.0 (the value is near the blue “nipple” in your IF-card).

When I add another logic-card, Homey says the result of the "parse-"card is the full JSON. Maybe the path is not correct?

 ![Scherm­afbeelding 2022-11-01 om 13.35.23](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/32db5bd2620b182dc34c290ba9423a0322280dea.png)

---

<div class="post-metadata">

**Author:** ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)\
**Post date:** [November 1, 2022, 1:59pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/31 "2022-11-01T13:59:23Z")

</div>

Are you trying to read the value in energy[0].level or write to it?

It seems you are trying to read the value which means you are using the wrong card.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/1/d1481ff2493db21fcfcfd3ca9cc42b2d83e4f1f7.png)

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [November 1, 2022, 2:40pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/32 "2022-11-01T14:40:36Z")

</div>

Awesome, that did the trick!! The card I used seemed to store the JSON value directly in a logic variable, but now I got it.

Thank you all for your help. And the solution for others with the same question in the future:

 ![Scherm­afbeelding 2022-11-01 om 15.39.52](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/0/60e8c49b7be6c9321b974553631430c969a8f9f4.png)

---

<div class="post-metadata">

**Author:** ![MarcoV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcov/32/12410_2.png) [@MarcoV](https://community.homey.app/u/MarcoV)\
**Post date:** [March 18, 2023, 8:17pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/33 "2023-03-18T20:17:43Z")

</div>

Does this also work without advanced flow, or is this a function of the advanced flow ?

I try to get information from the electric house boiler, but doesnot store the variable into logics.

Thanks

---

<div class="post-metadata">

**Author:** ![Rick\_Steijns](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rick_steijns/32/96988_2.png) [@Rick\_Steijns](https://community.homey.app/u/Rick_Steijns)\
**Post date:** [May 6, 2024, 9:44pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/34 "2024-05-06T21:44:00Z")

</div>

Hi Guys,

I have been trying to figure out how to store data from a get request in a similar way. I want to retrieve the 1h rain prediction from the agromonitoring API. I receive the following info:

{“dt”:1715031230,“weather”:[{“id”:301,“main”:“Drizzle”,“description”:“drizzle”,“icon”:“09n”},{“id”:500,“main”:“Rain”,“description”:“light rain”,“icon”:“10n”}],“main”:{“temp”:286.29,“feels\_like”:286.17,“temp\_min”:285.89,“temp\_max”:287.75,“pressure”:1012,“humidity”:96},“wind”:{“speed”:0.51,“deg”:190},“rain”:{“1h”:0.87},“clouds”:{“all”:100}}

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/f/2fc7e46b7b2b170569bbb3f3086899822c7f2f33.png)

I reckon the path is incorrect but don’t know how to fix this.

---

<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 6, 2024, 10:32pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/35 "2024-05-06T22:32:02Z")

</div>

Hello Rick, and welcome!

Check this similar question and the reply:

> [@Calling an external service and receiving the Response in a variable?](https://community.homey.app/t/calling-an-external-service-and-receiving-the-response-in-a-variable/12445/15):
>
> Hi @Erik, The flows you published are very nice. I have about the same question, but… I have a jsonfile where I get an hourly weather forecast. How can I get the data for example for 4 O’Clock instead off 3 O’Clock? {“plaatsnaam”:[{“plaats”:“Utrecht”}],“data”:[{“tijd”:“1564405200”,“tijd\_nl”:“29-07-2019 15:00”,“offset”:“07”,“loc”:“none”,“temp”:“26”,“winds”:“2”,“windb”:“2”,“windknp”:“4”,“windkmh”:“7.2”,“windr”:“190”,“windrltr”:“Z”,“neersl”:“0”,“luchtd”:“1011”,“luchtdmmhg”:“758”,“luchtdinhg”:“29…

Maybe this is useful as well:

> [@Setting up simple GET request and storing value as numeric logic object](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/20):
>
> Usecase: I want to retrieve from weatherunderground the precipitation (neerslag) for the coming 5 days. And store the 5 day values in the below created variables in Logic. Pre-requisites: 1.Better Logic App 2. HTTP Request App 3. Weatherunderground Api Key (for free) I took these steps: Create Numeric tags in Better Logic Create the API call via weatherunderground: Selected Geocode API, followed the instructions [here](https://docs.google.com/document/d/1_Zte7-SdOjnzBttb1-Y9e0Wgl0_3tah9dSwXUyEA3-c/edit): Selected format JSON Selected units M (m…

---

<div class="post-metadata">

**Author:** ![Rick\_Steijns](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rick_steijns/32/96988_2.png) [@Rick\_Steijns](https://community.homey.app/u/Rick_Steijns)\
**Post date:** [May 7, 2024, 8:39pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/36 "2024-05-07T20:39:44Z")

</div>

Thanks. Another post helped me. If a number is in the path ‘‘1h’’. use [‘1h’] instead of 1h.

[Previous page](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614.md?page=1)
