# How can I list all my levels into an array?

**URL:** <https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 18, 2018, 5:45pm UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909 "2018-10-18T17:45:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ifridos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ifridos](https://forums.unrealengine.com/u/Ifridos)\
**Post date:** [October 18, 2018, 5:45pm UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/1 "2018-10-18T17:45:09Z")

</div>

Hi guys,

so inspired by **veggiesaurus** answer on **[this thread][1]**, I’ve made a scrollable dynamic list of buttons that lead to several levels of my game.

The thing is that in order to add all those levels into the array I use to create the list, I “need” to manually do it like in the following screen capture. Therefore, my question is if there is any simpler, more elegant way to do the same, which is basically add the name of all my levels to the World List array.

 ![256963-bpquestion1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/4/ed403ca1510c17e68748dec4b51489e5f6e29662.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 18, 2018, 6:29pm UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/2 "2018-10-18T18:29:21Z")

</div>

Create a `string` | `struct` map in the Game Instance. Or even `string` | `int` if it’s as simple as you show above.

More info on maps:

> **[Blueprint Maps](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Maps/)**
>
> Creating and editing Map containers, an advanced container type, in Blueprints, including an overview of this container's properties.

* * *

Or use a data table, or create an array of string. Then use ForEach loop to populate the array in the widget.

* * *

edit: tbh, why not create the struct array to start with? Any reasons for that? You can select the array variable and populate it manually.

---

<div class="post-metadata">

**Author:** ![llll\_Sabre\_llll](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@llll\_Sabre\_llll](https://forums.unrealengine.com/u/llll_Sabre_llll)\
**Post date:** [October 19, 2018, 9:44am UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/3 "2018-10-19T09:44:25Z")

</div>

I was wondering why you linked to a page regarding Maps… and WTF?!  
I had no idea these existed!  
Whilst I understand why “Maps” makes sense as a name for them, given that term aready existed, it’sa terrible name choice. I probably spotted this a while ago and thought they were _levels_…

Awesome! Thanks. And Grr! For me not knowing about them. This engine is vast…

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 19, 2018, 10:13am UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/4 "2018-10-19T10:13:44Z")

</div>

Ha, they’re also referred to as _dictionaries_ so, yeah, naming conventions:

![257020-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/9/019bbd64fea12475ac34e4b213de0e8eb66e3e0b.png)

---

<div class="post-metadata">

**Author:** ![Ifridos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ifridos](https://forums.unrealengine.com/u/Ifridos)\
**Post date:** [October 19, 2018, 10:28am UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/5 "2018-10-19T10:28:18Z")

</div>

I was trying to avoid populating the array manually, but in the end it has been the quickest, most effective approach.  
Also, I didn’t know about maps in Unreal, and when I looked for them used the word dictionaries, so thanks for that too **Newest**

---

<div class="post-metadata">

**Author:** ![Zenahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zenahr](https://forums.unrealengine.com/u/Zenahr)\
**Post date:** [July 25, 2021, 11:47pm UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/6 "2021-07-25T23:47:55Z")

</div>

I couldn’t find a way to automatically get all .umap names so I just created a simple String array and filled the entries manually.

You could write a Python or bash script that returns all files with a .umap ending if really needed but I doubt it’s worth it (other than testing for missing map files)

---

<div class="post-metadata">

**Author:** ![vagabond00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vagabond00](https://forums.unrealengine.com/u/vagabond00)\
**Post date:** [July 9, 2022, 8:29pm UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/7 "2022-07-09T20:29:56Z")

</div>

A Map is a generic data term that predates the existence of the UE engine, but I can see why that would be confusing. UE is actually pretty good about using conventions found more broadly in computer science (especially the AI stuff).

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [July 11, 2022, 7:50am UTC](https://forums.unrealengine.com/t/how-can-i-list-all-my-levels-into-an-array/435909/8 "2022-07-11T07:50:35Z")

</div>

> [@List all maps in project or directory](https://forums.unrealengine.com/t/list-all-maps-in-project-or-directory/299256/12):
>
> For anyone finding this through Google search. This is how it’s done using Blueprint. You can also apply filters when working with the asset registry
