# How do I change my export \<data\> array ID's in JSON

**URL:** <https://discourse.mapeditor.org/t/how-do-i-change-my-export-data-array-ids-in-json/6919>\
**Category:** Questions\
**Created:** [August 11, 2024, 2:03am UTC](https://discourse.mapeditor.org/t/how-do-i-change-my-export-data-array-ids-in-json/6919 "2024-08-11T02:03:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry\_Bryant](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/henry_bryant/32/4687_2.png) [@Henry\_Bryant](https://discourse.mapeditor.org/u/Henry_Bryant)\
**Post date:** [August 11, 2024, 2:03am UTC](https://discourse.mapeditor.org/t/how-do-i-change-my-export-data-array-ids-in-json/6919/1 "2024-08-11T02:03:55Z")

</div>

Hello, I am trying to figure out how to change the id’s of my exported array.

Say I have an array that looks like this:

```auto
data:[2,2,2,
      2,1,2,
      2,2,2]

```

How do I export the JSON so the data looks like this:

```auto
data:[1,1,1,
      1,2,1,
      1,1,1]

```

Also I have manually changed the tile ID’s in the .tsx file, and when I go back to the Tiled map editor the map looks inverted like I want. But when I export the JSON file, the data array does not change at all.

Would I have to create a new tileset, and then load the images into the editor in inverse order? There has to be some easy way to do this without doing so.

Many thanks.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [August 11, 2024, 2:08am UTC](https://discourse.mapeditor.org/t/how-do-i-change-my-export-data-array-ids-in-json/6919/2 "2024-08-11T02:08:26Z")

</div>

If you change the tile IDs in the Tileset file, the map will just load the wrong tiles in each place. If you want to change the tile IDs in the Tileset _and_ the map, you’ll need to replace all instance of tile 2 with 1, and of tile 1 with 2, and then you’ll get the export you want.

Generally though, tile IDs shouldn’t matter beyond just being a way to figure out _which_ tile is used. This is why there are no built-in tools to change tile IDs like you want. You should really think about exactly _why_ you need the IDs reversed, and whether your goals wouldn’t be better-accomplished by other means. If you really do need IDs reversed, you can switch the tiles around properly (instead of only half-way as you did before), or write a custom export format.

---

<div class="post-metadata">

**Author:** ![Henry\_Bryant](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/henry_bryant/32/4687_2.png) [@Henry\_Bryant](https://discourse.mapeditor.org/u/Henry_Bryant)\
**Post date:** [August 11, 2024, 2:23am UTC](https://discourse.mapeditor.org/t/how-do-i-change-my-export-data-array-ids-in-json/6919/3 "2024-08-11T02:23:04Z")

</div>

Thanks, this seems to have worked well.
