# \[SOLVED\] Using a variable to set the property variable to get an object returns undefined

**URL:** <https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501>\
**Category:** Questions about Thunkable X\
**Created:** [August 22, 2019, 5:45pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501 "2019-08-22T17:45:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)\
**Post date:** [August 22, 2019, 5:45pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/1 "2019-08-22T17:45:29Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cb388cd0188e884faf99b237b0c906c4b399d2b0.png)

If I used a variable to set the property to get an object returns me undefined but if I set the property with anything but a variable it works fine!

So if anyone is having a problem beware of this! is till works fine you would have to set the text of any block and then use that block text to set the property variable, Don’t be lazy like me 😄

Does anyone happen the same?

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)\
**Post date:** [August 22, 2019, 5:59pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/2 "2019-08-22T17:59:57Z")

</div>

> [@Daniel\_Coglitore](#):
>
> If I used a variable to set the property to get an object returns me undefined but if I set the property with anything but a variable it works fine!

Daniel,

Do you really mean “set” in your statement above? I ask because your example blocks are `get` blocks.

-Mark

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)\
**Post date:** [August 22, 2019, 6:10pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/3 "2019-08-22T18:10:31Z")

</div>

Nevertheless, I see the bug. Thanks for discovering this, @Daniel_Coglitore! We’ll get to work on fixing it.

-Mark

---

<div class="post-metadata">

**Author:** ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)\
**Post date:** [August 22, 2019, 6:13pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/4 "2019-08-22T18:13:38Z")

</div>

sorry for my bad english haha !  
ok ! Thank you ! 🙌

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [August 22, 2019, 6:57pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/5 "2019-08-22T18:57:34Z")

</div>

If you need to urgently work with an object, then instead of the app variable to which the object is assigned, use the variable created from the function block.

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/b/4b2d45116cc820e6c03aba9263f7fb541f18fe29.png)

---

<div class="post-metadata">

**Author:** ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)\
**Post date:** [August 22, 2019, 7:11pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/6 "2019-08-22T19:11:40Z")

</div>

did that work for you ? it doesn’t return undefined? if I set the "get property variable within another variable directly it returns me undefined and apparently for Mark it happened the same since he told he found a bug 😅

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [August 22, 2019, 7:15pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/7 "2019-08-22T19:15:22Z")

</div>

The error is that the object is simply not stored in the app variable (more precisely, an empty object is stored in which there are no properties). Does my example work for you?

---

<div class="post-metadata">

**Author:** ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)\
**Post date:** [August 22, 2019, 7:22pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/8 "2019-08-22T19:22:53Z")

</div>

For example the “refObject” variable is not the error I get, the error comes from “app name1” Apparently when using that directly It doesn’t work , I have to set the “app name1” to another text block and then use that text block to get the refObject , for me doesnt work I dont know for you =S

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [August 23, 2019, 9:00am UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/9 "2019-08-23T09:00:13Z")

</div>

If you cannot jump over the hole, then try to get around it.

To work with objects on one screen, use relObject, and before go to another screen, convert this object to JSON and save it in the “app” variable.

---

<div class="post-metadata">

**Author:** ![neuheisser](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@neuheisser](https://community.thunkable.com/u/neuheisser)\
**Post date:** [September 4, 2020, 2:43pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/10 "2020-09-04T14:43:19Z")

</div>

Hello Mark,  
I’m having really bad times with objects and variables.  
I’m trying to store object in a variable, and then change properties of an object according to other variables.  
But it doesn’t work.  
I’m trying to send an object to create Airtable Row, and if I do it straight (object created directly attached to AT block) it works, but if I first store object to variable, and then try to send it, it doesn’t work.  
You already said that there is a bug, but it was last year. Is the bug still there?  
Thanks!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 4, 2020, 3:40pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/11 "2020-09-04T15:40:52Z")

</div>

To search for any errors and bugs, you need to display all the data on the screen…

---

<div class="post-metadata">

**Author:** ![neuheisser](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@neuheisser](https://community.thunkable.com/u/neuheisser)\
**Post date:** [September 4, 2020, 6:29pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/12 "2020-09-04T18:29:31Z")

</div>

Is it possible to store object into variable? Do you know?

---

<div class="post-metadata">

**Author:** ![neuheisser](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@neuheisser](https://community.thunkable.com/u/neuheisser)\
**Post date:** [September 4, 2020, 11:12pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/13 "2020-09-04T23:12:55Z")

</div>

OK - I found out - the variable stores the object, BUT  
AIRTABLE Create Row block cannot send variable BEFORE IT GETS CONVERTED TO JSON AND BACK!!! ![Screen Shot 2020-09-05 at 01.23.28](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/2/e240048a73e0de9cc1f97cac7d46efb1edc7164a.png)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 5, 2020, 7:51am UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/14 "2020-09-05T07:51:37Z")

</div>

Strangely, it turns out that to transfer an object, you need to perform unnecessary operation. I haven’t checked this, but I know that sometimes you have to perform extra operations to make something work properly.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:11pm UTC](https://community.thunkable.com/t/solved-using-a-variable-to-set-the-property-variable-to-get-an-object-returns-undefined/192501/15 "2024-11-08T12:11:47Z")

</div>


