# Problems with data driven variables setting image height and Width (DND)

**URL:** https://community.thunkable.com/t/problems-with-data-driven-variables-setting-image-height-and-width-dnd/3257308
**Category:** Issues / Bugs
**Tags:** help
**Created:** [October 8, 2024, 3:35pm UTC](https://community.thunkable.com/t/problems-with-data-driven-variables-setting-image-height-and-width-dnd/3257308 "2024-10-08T15:35:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [October 8, 2024, 3:35pm UTC](https://community.thunkable.com/t/problems-with-data-driven-variables-setting-image-height-and-width-dnd/3257308/1 "2024-10-08T15:35:04Z")

</div>

When I create a local data source with X and Y and height and width values for a image component and assign to variables to insert into Set code to assign relevant values to the image attributes of X,Y,Height, Width. The image does not display, If I hard code the values into a varaibale and test the image appears correctly. I have initialised the variables asinstead of number as did a test code of maths and worked ok. Ran some test code to check was pulling correct values , it is not being treated as text number values as tested maths on variables as pulled from data source . Run out of ideas is this a BUG? - any ideas appreciated.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [October 8, 2024, 7:52pm UTC](https://community.thunkable.com/t/problems-with-data-driven-variables-setting-image-height-and-width-dnd/3257308/2 "2024-10-08T19:52:22Z")

</div>

You can convert a text string to a numer by adding 0 to it or multiplying it by 1.

---

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [October 9, 2024, 4:19pm UTC](https://community.thunkable.com/t/problems-with-data-driven-variables-setting-image-height-and-width-dnd/3257308/3 "2024-10-09T16:19:02Z")

</div>

Tried that , negative, thx for response tho

---

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [October 9, 2024, 4:24pm UTC](https://community.thunkable.com/t/problems-with-data-driven-variables-setting-image-height-and-width-dnd/3257308/4 "2024-10-09T16:24:34Z")

</div>

Apologies tried x1 and it solved it , thx again  
Thought I had already done a math expression on var but that route of multiply by 1 worked where addition did not
