# How to get a column in Firebase and display it in Listview?

**URL:** <https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005>\
**Category:** Questions about Thunkable X\
**Created:** [April 21, 2019, 7:43am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005 "2019-04-21T07:43:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 21, 2019, 7:43am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/1 "2019-04-21T07:43:13Z")

</div>

Dear Thunk-friends,

I have a Firebase database in which I have the vocabulary I need to study (just as the picture). I want to concatenate the column “portuguese” and “alemão” and display the result in a ListView as “Guten Morgen - bom dia”, “Guten Tag - boa tarde”.

![Capturar2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/3/03d2315afc2e0b45fdeecbc3dfb428fceeb5051f.jpeg)

It’s not working. In a local database I did the same and it was working…

 ![Capturar](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/b/fbe2a9e0013217e053a2ee2f65b279009df5125f.jpeg)

Any ideas?

---

<div class="post-metadata">

**Author:** ![Cian\_O\_Sullivan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cian_o_sullivan/32/34494_2.png) [@Cian\_O\_Sullivan](https://community.thunkable.com/u/Cian_O_Sullivan)\
**Post date:** [April 23, 2019, 12:36am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/2 "2019-04-23T00:36:52Z")

</div>

Can you please show a mock up of what you want the result to show?

I think I know, however I can be very slow so I need more details 🙂

---

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 23, 2019, 8:26am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/3 "2019-04-23T08:26:08Z")

</div>

Well, I was just preparing to answer you when I had an insight!

This code written above was to get some of my vocabulary from a firebase database and display it to me in a list view.

I expected to get:

Guten tag - bom dia  
Gute Nacht - boa noite  
…

But the only thing I was getting was an empty list or a list with one item. Remember yesterday in my previous post that I said I had to put a function WAIT…SENCONDS for some task to work? Prior to sending you this message, I tried it here and it worked.

Here would be a solution:

 ![t1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/2/828c83d7d859e139eb6e2920bce445de31f79041.jpeg)

I might be wrong, but I feel that everytime you have a CALL FROM DATABASE statement inside a FOR EACH J statement, you MUST put this WAIT…SECONDS to get it to work.

It seems to be a problem from the platform. To debug this error I inserted a label on my screen to show in which variable J the app was to understand why my list wasn’t being built. I found that the app would crazily make a list of J’s without accomplishing the task inside the statement.

Another problem is that you cannot trust the results shown. For example: if you ask the app to WAIT 2 SECONDS between getting the results, you get wrong outputs. Take a look below.

If my code had another WAIT…SECONDS:

 ![t2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/072a88ec74663388d16ede488b4dcb6c3f2a62f6.jpeg)

the outputs from the app would be repeated with one word refferring to more that one meaning:

 ![2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/c/cc5c4844ee6d30f8ed56cdbfcbacb5e9c5ec509e.jpeg)

When I remove the extra WAIT…SECONDS, what I get is

 ![1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/9/3925cda8001bd5284f354f05f36214d0875c7c01.jpeg)  
Note that the first word from the list will never appear and I got no idea why! Just accept and be happy! 🤣

My conclusion is that you cannot trust it at all. Maybe what I will have to do is to make that WEB API you told me about yesterday. In fact I tried, but I still get no result and I have no clue about where my problem is.

---

<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:** [April 23, 2019, 3:04pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/4 "2019-04-23T15:04:17Z")

</div>

Hi,

If you can export the database data to JSON format and send it to me, then I will look at the algorithm. I do not think that there is great difficulty.

The idea is simple. Need nodes 0,1,2 and so on. get as a list of objects. After that, you can display any data from this list of objects in the ListViewer.

---

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 23, 2019, 3:46pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/5 "2019-04-23T15:46:14Z")

</div>

Wow, thank you so much for trying to help me. I might have done a silly mistake there, but I cannot identify… As it doesn’t return anything, maybe it could also have a problem to connect to the json.

I made a blank app just to run tests. The link is [https://x.thunkable.com/copy/24b02d9b9d14a0ad9b5bdab6c0464027](https://x.thunkable.com/copy/24b02d9b9d14a0ad9b5bdab6c0464027)

My json address is [https://myvocab-30705.firebaseio.com/.json](https://myvocab-30705.firebaseio.com/.json)

Thank you once again!

---

<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:** [April 23, 2019, 3:49pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/6 "2019-04-23T15:49:17Z")

</div>

I need to leave now, so I will show my example, which I did. If you do not understand, then in 3-4 hours I can make your example.

![%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/c/6/c63543940522f5a6213760e652bd887cca62aee8.png)

 ![%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/4bf9aab21ac80ee156c5d7234ddd615cc6a92a01.png)

---

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 23, 2019, 4:30pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/7 "2019-04-23T16:30:27Z")

</div>

Oh, thank you! I did mine similar to yours. It’s missing a purple statement that I don’t know what it is. Can you show me when you come back?

![Sem%20t%C3%ADtulo](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/9/f97ada7e0f457707ba6bc514f3a1a9e8c41b65c1.jpeg)

---

<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:** [April 23, 2019, 6:41pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/8 "2019-04-23T18:41:39Z")

</div>

I log into the database using email and password, so the block is like that. Therefore, I added the SignIn block in order to quickly show my example. I think you don’t need this block here)

 ![%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/3/e/3e8c0785fe739354c2edcf3085d6268f8f023cc0.png)

---

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 23, 2019, 7:26pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/9 "2019-04-23T19:26:30Z")

</div>

You are right, in my case I don’t need this block. In your app can you really display this list? In mine it doesn’t work…

If I put the key=“commands” (in my case “myvocab-30705”), the list is not displayed. Instead, if I put a number, requesting only one row, it really works.

![Capturar](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/e/ced1d513063d7131ea66677a473058c268c175ec.jpeg)

![Capturar](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/8/28c12cfae0cf5cb0af1ee8d85d05458e94415e43.jpeg)

If you could, would you take a look at this for me? The project is on [Thunkable](https://x.thunkable.com/copy/24b02d9b9d14a0ad9b5bdab6c0464027). It contains only one screen to make the tests easier.

---

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 23, 2019, 9:29pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/10 "2019-04-23T21:29:21Z")

</div>

Guys, I have an update. Based on what actech sent previously, I made some changes and it really worked for me.

![Capturar](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/f/bfdbdcc5d6c553f930841c0817de2c708ebdfe91.jpeg)

Some extra information:

1. If I remove WAIT…SECONDS the app crashes;
2. I use app response 1 (and 2) to get the info from the firebase, generanting a JSON object. The problem is that this object comes between " ". To remove these " I use the property get object from JSON. Now you ask me? Why didn’t you put everything together, in only one line?!?!?! Because it crashes!

Hope I could help anyone with my crash history. Now I’m like a headless chicken (and crashed!).

Thank you guys for all your support!

---

<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:** [April 24, 2019, 7:21am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/11 "2019-04-24T07:21:58Z")

</div>

My blocks are 100% working, but they work for FireBase. Now I will make your blocks.

If you give me your ThunkableX app for FireBase project and Firebase Settings (API Key and Database URL)to it (in a personal message), then I will help you to make it work.

---

<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:** [April 24, 2019, 7:42am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/12 "2019-04-24T07:42:26Z")

</div>

The difficulty is that you are a bit confused with how to specify the paths to nodes in the database, what is the list of objects. You have nodes 0, 1 … 42. You need to create a parent node and move all these nodes into it, as shown in my example.

In my example, the parent node “commands” and all nodes are in it.

---

<div class="post-metadata">

**Author:** ![IWendling](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/iwendling/32/31718_2.png) [@IWendling](https://community.thunkable.com/u/IWendling)\
**Post date:** [April 24, 2019, 8:11am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/14 "2019-04-24T08:11:19Z")

</div>

I think this was my problem! I still don’t know how to use nodes. I was skimming through other examples and I realized that my json structure is a bit different from the ones people usually have. I am really making a confusion.

I made 2 different databases and they look just the same (except for the ID I added to the second):

 ![1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/2/e28e972cebde9144c217acbc915fb33f3ac54f1c.jpeg)  
Database 1: [https://myvocab-30705.firebaseio.com/.json](https://myvocab-30705.firebaseio.com/.json)  
Database 2: [https://vocab2-2353a.firebaseio.com/.json](https://vocab2-2353a.firebaseio.com/.json)

When I look at the JSON file, there I find the difference:  
**Database 1** : {“0”:{“Alemao”:“Guten Morgen”,“Box”:0,“Data”:"",“Nivel”:“A1”,“Portugues”:“bom dia”,“aux”:""},…}

**Database 2** : [{“Alemao”:“Guten Morgen”,“Box”:0,“Data”:"",“Nivel”:“A1”,“Portugues”:“bom dia”,“aux”:"",“id”:1},…]

This is the confusion I am making. My JSON was originally written as DATABASE 1, and most of the examples I saw contain a JSON file like DATABASE 2.

---

<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:** [April 24, 2019, 8:12am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/15 "2019-04-24T08:12:57Z")

</div>

Now I will tell

---

<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:** [April 24, 2019, 8:16am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/16 "2019-04-24T08:16:00Z")

</div>

1. Create a “myvocab” node in the database with a value, for example, 1
2. Open this node “myvocab” and import the file [voc.txt](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/e/1e7d9257996dcc4dbf4f328226db0893d69aa78d.txt) (5.5 KB)  
into it. It should be such a structure  
 ![%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/6/464dda82fe4e05dba79d94d778d4fbfa58b3a17a.png)
3. Use 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/7/2/72193d74f0ccd2ef294656ec7c867be8afc0beef.png)

---

<div class="post-metadata">

**Author:** ![gpo](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gpo](https://community.thunkable.com/u/gpo)\
**Post date:** [December 5, 2020, 3:01am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/17 "2020-12-05T03:01:22Z")

</div>

actech: I replicated your blocks but cannot get it to work. Can you take a look at the blocks and Firebase info below? Greatly appreciate any help.

 ![Screen Shot 2020-12-04 at 6.58.29 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/4/3421f9340e254e837e96f52d89101032654294a5.jpeg) ![Screen Shot 2020-12-04 at 6.58.45 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/b/7bde01aec4353796391e7d67791633b936393bb7.jpeg)

---

<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:** [December 5, 2020, 9:25am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/18 "2020-12-05T09:25:23Z")

</div>

To get the value of a field, you must correctly specify the path to this field. To do this, select a field and look at the path to it above the tree area, for example,

![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/b/bbadf6acbfb3dbe92caa4d92b4bfd2df61433e6f.png)

The path in my example is highlighted in a red frame

---

<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:** [December 5, 2020, 9:56am UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/19 "2020-12-05T09:56:56Z")

</div>

@gpo Try this:

 ![Screen Shot 2020-12-05 at 1.56.29 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/9/998f90ca293e1245b9a1f896da2fc1830876a6c5.png)

---

<div class="post-metadata">

**Author:** ![gpo](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gpo](https://community.thunkable.com/u/gpo)\
**Post date:** [December 5, 2020, 4:44pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/20 "2020-12-05T16:44:13Z")

</div>

The “cloud” variable will know to hit Firebase? Do I initialize “cloud?” Thanks

---

<div class="post-metadata">

**Author:** ![gpo](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gpo](https://community.thunkable.com/u/gpo)\
**Post date:** [December 5, 2020, 4:47pm UTC](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005/21 "2020-12-05T16:47:27Z")

</div>

See attached screenshot. It seems I have it right? I am trying to pull all userNames into a list. How doI handle the UUID?

 ![Screen Shot 2020-12-05 at 8.45.15 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/3/7327d7b25414a8b0c878a5dfddca3e4550732add.jpeg)

[Next page](https://community.thunkable.com/t/how-to-get-a-column-in-firebase-and-display-it-in-listview/75005.md?page=2)
