# Can someone please help me with thunkable ( firebase )

**URL:** <https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581>\
**Category:** Questions about Thunkable X\
**Tags:** firebase\
**Created:** [July 13, 2018, 7:28am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581 "2018-07-13T07:28:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 7:28am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/1 "2018-07-13T07:28:32Z")

</div>

What i want to do is the following.  
For my employer i"m trying to develop an app that does this:

- search in firebase for the entered text.
- if text has been found send it to another user + commentary why text has been sent to said user.

Example : i have a product wich has the follwing data:

- code = 132453
- description = gauge pressure
- manufacturer = mitsubishi
- Type number = elko132

after investigation i notice the type number is wrong , so i open the app and search for this particular item by Code, description, manufacturer or type number. ( example: i put in the items code, 132453 and everything displays in a separate text box, one for code one for description etc.)  
when the data is found i can put in commentary like: please change type number to - something.  
after that a user gets a notification and changes the type number in our main database ( outside the app ).

I exported all the items in our database via cvs and changed it to json, then i uploaded it to firebase and this is how it came out.

 ![Firesbase%20screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/f/2f9c07c0b3a05da1a5b86400deeb89d20071cde6.PNG)

I dont understand the random numbers that have been given, 9099, 91, 910 Etc.  
But there are 50K plus items in the database and i have tried and tried but nothing seems to work…

Please would anyone be so kind to help me out here!?

---

<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:** [July 13, 2018, 7:35am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/2 "2018-07-13T07:35:04Z")

</div>

I correctly understand that the problem is in the wrong data format when importing them into Firebase? If so, the problem is in the format of the imported file. First, try creating a test json with 10 entries and import it into the database. If everything is in order, then use this format to import a lot of data.

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 9:15am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/3 "2018-07-13T09:15:11Z")

</div>

I got what the problem is , i can now search for the numbers behind the + sign , example: i search for 9100 and it displays my code , description, manufacturer and type number.

But i want to at least be able to search by code, is there any quick way to change the random numbers behind the+ sign to the code number or any tricks or something?

---

<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:** [July 13, 2018, 9:20am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/4 "2018-07-13T09:20:13Z")

</div>

Try to use the loop on all nodes.

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 9:34am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/5 "2018-07-13T09:34:46Z")

</div>

the problem i have is in my employers database i exported everything and made a json out of it, if i open it in notepad++ i see this

 ![notepad%20%20](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f6733dbd3bad4c93ca47447bc5bec1385216421f.PNG)

But when i import it into firebase it chooses random parents like this ![Firesbase%20screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/6/7663b5d983cca456683742419c9d954430fd4b1f.PNG)

Is there any way for me to search for the child categories instead of the random number parent categories, maybe change the parent categories to something else fast cause i got like 50K plus entries…

---

<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:** [July 13, 2018, 9:37am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/6 "2018-07-13T09:37:48Z")

</div>

I’ll try to simulate your situation in my database and write you the answer.

---

<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:** [July 13, 2018, 9:38am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/7 "2018-07-13T09:38:57Z")

</div>

Can you give me a textual part of your code from the very beginning to the 11th entry so that I do not manually fill it?

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 9:40am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/8 "2018-07-13T09:40:11Z")

</div>

{  
“Code”: 100008,  
“Type number”: “161/1”,  
“Description”: “SOCKET TL-”,  
“Manufacturer”: “SCHUCH”  
},  
{  
“Code”: 100016,  
“Type number”: “BS-38 3/8”,  
“Description”: “SEAL BONDED-”,  
“Manufacturer”: “HY-FIT”  
},  
{  
“Code”: 100024,  
“Type number”: “000.003.245 JFM-4044-30”,  
“Description”: “BEARING SLIDE-”,  
“Manufacturer”: “DEMATIC (EGEMIN)”  
},  
{  
“Code”: 100032,  
“Type number”: “RMU 50FL C25 M1 71 B5”,  
“Description”: “MOTOR + GEARBOX”,  
“Manufacturer”: “VELA”  
},  
{  
“Code”: 100040,  
“Type number”: “SX-11 7KG/5L”,  
“Description”: “DESCALER”,  
“Manufacturer”: “ZEP”  
},  
{  
“Code”: 100057,  
“Type number”: “79.3.31.SXD.032”,  
“Description”: “SHAFT CHUCKNOSE XC PS-6”,  
“Manufacturer”: “FUJI”  
},  
{  
“Code”: 100065,  
“Type number”: “B-1460-2 DVR”,  
“Description”: “ARM HINGE-”,  
“Manufacturer”: “TAKIGEN”  
},

These are some entries , is this enough ?

---

<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:** [July 13, 2018, 9:41am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/9 "2018-07-13T09:41:44Z")

</div>

Thanks, it seems I already see the problem.

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 9:42am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/10 "2018-07-13T09:42:04Z")

</div>

you do?

---

<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:** [July 13, 2018, 9:42am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/11 "2018-07-13T09:42:39Z")

</div>

I’ll check my guess and write to you.

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 9:43am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/12 "2018-07-13T09:43:42Z")

</div>

great, 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:** [July 13, 2018, 9:57am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/13 "2018-07-13T09:57:24Z")

</div>

The fact is that your records do not have a root node and therefore Firebase gives them random values. Your data format must be such

```
{
  "100008" : {
	"Type number": "161/1",
	"Description": "SOCKET TL-",
	"Manufacturer": "SCHUCH"
  },
  "100016":{
	"Type number": "BS-38 3/8",
	"Description": "SEAL BONDED-",
	"Manufacturer": "HY-FIT"
  }
}

```

Here, “100008” is the Code and root recording node.

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 10:01am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/14 "2018-07-13T10:01:40Z")

</div>

Yeah i just noticed aswell it just does this dfor every entry: 1,2,3 etc up to the last one wich is 50000 something.

Now is there a Way for me to make the code the root node in every entry without having to manually do it ? Cause that would take me weeks

---

<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:** [July 13, 2018, 10:04am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/15 "2018-07-13T10:04:51Z")

</div>

You do not need to edit anything manually. It is necessary to make the replacement of the text in automatic mode. Do you know any scripting languages ​​for programming - php, javascript, etc.?

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 10:06am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/16 "2018-07-13T10:06:03Z")

</div>

I don 't sadly…

---

<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:** [July 13, 2018, 10:08am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/17 "2018-07-13T10:08:20Z")

</div>

All replacements are easy to do with the help of, for example, javascript.

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 10:09am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/18 "2018-07-13T10:09:45Z")

</div>

So i could just write a code at the top or bottom in notepad++ to make (Code) root node and then save it as json and import it to firebase?

---

<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:** [July 13, 2018, 10:11am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/19 "2018-07-13T10:11:23Z")

</div>

Do you want to do this manually?

---

<div class="post-metadata">

**Author:** ![clip\_switch](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@clip\_switch](https://community.thunkable.com/u/clip_switch)\
**Post date:** [July 13, 2018, 10:11am UTC](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581/20 "2018-07-13T10:11:42Z")

</div>

rootNode = node.getRootNode(Code);

Is this okay?

[Next page](https://community.thunkable.com/t/can-someone-please-help-me-with-thunkable-firebase/35581.md?page=2)
