# Input datas... Please help

**URL:** <https://forum.wixstudio.com/t/input-datas-please-help/9704>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [July 7, 2018, 12:21pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704 "2018-07-07T12:21:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 7, 2018, 12:21pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/1 "2018-07-07T12:21:16Z")

</div>

![](https://us1.discourse-cdn.com/wix/original/3X/e/8/e8f5a703744cfaa6c82a202964f110710f190dc8.jpeg)  
I have this dynamic page (1).

The titles are connected to my “Artists” database

The table below is connected to my “Titles” database

 ![](https://us1.discourse-cdn.com/wix/original/3X/a/b/ab909ddabf2fc3c55857a4e6e35daeb8f9d52466.jpeg)

This is my “titles imput” page (2). When I enter all fields, it works, except the “Artist” field (3)

 ![](https://us1.discourse-cdn.com/wix/original/3X/6/7/674487ca1b696969859594e3a57e37dc533b703d.jpeg)

How to make that when I enter the name of the artist on my page (2), it is integrated in the good dynamic page “Artist” (5)

Please help me. Please. What am I supposed to do? What code was used? How to integrate it?

Thank you in advance for your answers. I’m desperate.

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 8, 2018, 2:33pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/2 "2018-07-08T14:33:32Z")

</div>

up

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 9, 2018, 4:48am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/3 "2018-07-09T04:48:18Z")

</div>

Nobody to help me ?

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 12, 2018, 5:10pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/4 "2018-07-12T17:10:09Z")

</div>

Up

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 15, 2018, 10:23am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/5 "2018-07-15T10:23:31Z")

</div>

Really need help ! ☹

---

<div class="post-metadata">

**Author:** ![\_tal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/_tal/32/669_2.png) [@\_tal](https://forum.wixstudio.com/u/_tal)\
**Post date:** [July 17, 2018, 7:51am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/6 "2018-07-17T07:51:27Z")

</div>

Hi,  
I’m truly sorry for the delay. Firstly, note that the grey columns are created automatically when creating a dynamic page and based on the settings of it. You cannot edit it. Moreover, the images are a bit blurry so I was not quit sure what you were referring. Can you please send us the site URL so that I can have a look?

Thanks,  
Tal.

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 18, 2018, 11:13am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/7 "2018-07-18T11:13:54Z")

</div>

[https://karlbertrand43.wixsite.com/listkara/titres-title](https://karlbertrand43.wixsite.com/listkara/titres-title)

Only the field “Artistes” don’t work. You can make try if you want

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 22, 2018, 10:54am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/8 "2018-07-22T10:54:58Z")

</div>

Up

---

<div class="post-metadata">

**Author:** ![shlomi-shemesh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@shlomi-shemesh](https://forum.wixstudio.com/u/shlomi-shemesh)\
**Post date:** [July 24, 2018, 1:52pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/9 "2018-07-24T13:52:24Z")

</div>

Hi Karl,

if i understand your question correct, you have a form ‘AJOUTS TITRES’ in which you want to add a new item but one of the input is a reference to the artist table?  
so it should be a drop down of artists right?  
in the collection in the db, although you see in the editor the title of the artists, what’s really being kept is the \_id of the other collection.

Shlomi

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 24, 2018, 2:10pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/10 "2018-07-24T14:10:22Z")

</div>

The names of the artists were previously created in a separate database, to have their own dynamic page

What I want is that when I enter the artist’s name in the “Artist” field (first picture),

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/a/1a599b199f71717905cc8ccd63c5da64b2f271c7.jpeg)

I want it to automatically enter it in the database (second image) in the “Artist” field. (The “Artist” field in the database is a drop-down menu)

 ![](https://us1.discourse-cdn.com/wix/original/3X/4/e/4e7a0e30717e32728df808c8af02d1e8bbd33855.png)

So far, when I go through my add title page, it leaves the “Artist” field empty. Everything else fills up normally. So in the database, I have to manually enter the names of the artists

(Sorry about my English, I’m French)

---

<div class="post-metadata">

**Author:** ![shlomi-shemesh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@shlomi-shemesh](https://forum.wixstudio.com/u/shlomi-shemesh)\
**Post date:** [July 24, 2018, 2:36pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/11 "2018-07-24T14:36:03Z")

</div>

Hi Karl,

ok, i understand. as i wrote above, in the db collection editing you have in the editor there is a UI trick, you insert the artist name ‘Artiste’ because it is your collection primary field but it actually saves the ‘ID’ of the collection record in the db. this is why it will not work just like that in the form

 ![](https://us1.discourse-cdn.com/wix/original/3X/2/5/2579e2c9e5b87266c360d67b1d35c6accefa192f.png)

please also think about spelling mistake and validations, in case the input artist does not appear in the db. please also keep in mind that currently you can also create artists in the collection with an identical name (different ID)  
so in the form you need to create some kind of a search on the artist collection the user can choose from, keep the and then before submitting the form set the ID value in the artiste field of your Titres collection

hope i was able to explain the issue,  
Shlomi

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 24, 2018, 2:41pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/12 "2018-07-24T14:41:23Z")

</div>

Thanks for your answer, but I didn’t get it all: p

What do you mean, I’m putting this in place? Can you give me a practical example?

---

<div class="post-metadata">

**Author:** ![shlomi-shemesh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@shlomi-shemesh](https://forum.wixstudio.com/u/shlomi-shemesh)\
**Post date:** [July 24, 2018, 2:54pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/13 "2018-07-24T14:54:48Z")

</div>

run this code below in your page and see in preview console what you get:

```javascript
import wixData from 'wix-data';

$w.onReady(async function () {
 let artist = await wixData.get('Titres','59e91716-caf6-4249-b0cc-31bf6ac34c8a');
    console.log(artist);
    console.log(artist.artiste)
});

```

Shlomi

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 24, 2018, 3:14pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/14 "2018-07-24T15:14:12Z")

</div>

Don’t worrk 😕

there’s something I don’t have to do right. Do you have a wix address that I send you a copy of the site? Maybe it’ll be easier

---

<div class="post-metadata">

**Author:** ![shlomi-shemesh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@shlomi-shemesh](https://forum.wixstudio.com/u/shlomi-shemesh)\
**Post date:** [July 24, 2018, 3:24pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/15 "2018-07-24T15:24:52Z")

</div>

Hey,

i am able to see your site’s code, running it this is what i get:  
{“\_id”:“59e91716-caf6-4249-b0cc-31bf6ac34c8a”,“\_owner”:“51b05dc5-5c08-4a3e-9875-6fe08f218e63”,“\_createdDate”:“2018-07-24T14:24:55.768Z”,“\_updatedDate”:“2018-07-24T14:26:45.558Z”,“title”:“Medley (Live "La Dernière Danse" 2017)”,“inputArtist”:“Michel Sardou”,“artiste”:“e735c657-ad4c-423e-9741-b82f773fbc99”,“annee”:“2017”,“live”:“Live”,“languePrincipale”:“Français”}

e735c657-ad4c-423e-9741-b82f773fbc99

but my point is that the actual data you should save in the db is the ID, not the name. so when using a form with an artist name as a reference field, it should contain the ID of the referenced artist. this is why the current form is not working for you.

Shlomi

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 24, 2018, 3:33pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/16 "2018-07-24T15:33:29Z")

</div>

I’m completely lost 😛 If someone wants to make the correction, send me an email, and I will send you a copy of the site. ([karlbertrand43@gmail.com](mailto:karlbertrand43@gmail.com))

---

<div class="post-metadata">

**Author:** ![shlomi-shemesh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@shlomi-shemesh](https://forum.wixstudio.com/u/shlomi-shemesh)\
**Post date:** [July 24, 2018, 5:08pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/17 "2018-07-24T17:08:14Z")

</div>

Karl,

please see similar discussion here:

> **[Filling a reference field with a form input | Velo by Wix](https://community.wix.com/velo/forum/coding-with-velo/filling-a-reference-field-with-a-form-input)**
>
> hi,
> I have connected two databases with a reference field; Apartments and Clients. Basically each apartment will have one or more clients. So when i click the apartment name it will show all the clients related to it. I intend to fill the clients...

Shlomi

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 26, 2018, 7:41am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/18 "2018-07-26T07:41:53Z")

</div>

Where am I wrong ?

$w.onReady( **function** () {  
//TODO: write your page related code here…

});

**import** wixData **from** ‘wix-data’;

export function button1\_click(event, $w) {

```
wixData.query('Titres') 
.eq('Artiste', $w('#input14').value) 
    .find()  
    .then(res => { 

```

**let** firstItem = res.items[0];  
**let** toInsert = {  
“Artiste”: firstItem,  
“Title”: $w(“#input14”).value  
};  
wixData.insert(“Titres”, toInsert)  
.then((results) =\> {  
**let** item = results;  
})  
. **catch** ((err) =\> {  
**let** errorMsg = err;  
});  
});  
}

---

<div class="post-metadata">

**Author:** ![shlomi-shemesh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@shlomi-shemesh](https://forum.wixstudio.com/u/shlomi-shemesh)\
**Post date:** [July 26, 2018, 11:59am UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/19 "2018-07-26T11:59:40Z")

</div>

Hi,

if you will add a console.log(firstItem) of the item you load from the db, you will see that this is the entire json object. you just need to thake the \_id form this object to be put in the ‘Artiste’ field

Shlomi

---

<div class="post-metadata">

**Author:** ![bestclubvipkaraoke](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bestclubvipkaraoke/32/5247_2.png) [@bestclubvipkaraoke](https://forum.wixstudio.com/u/bestclubvipkaraoke)\
**Post date:** [July 26, 2018, 12:09pm UTC](https://forum.wixstudio.com/t/input-datas-please-help/9704/20 "2018-07-26T12:09:18Z")

</div>

???

[Next page](https://forum.wixstudio.com/t/input-datas-please-help/9704.md?page=2)
