# Users edit his own entry on a database

**URL:** <https://forum.wixstudio.com/t/users-edit-his-own-entry-on-a-database/20937>\
**Category:** Ask the community\
**Tags:** wix-members-area, question, code\
**Created:** [May 26, 2020, 9:03pm UTC](https://forum.wixstudio.com/t/users-edit-his-own-entry-on-a-database/20937 "2020-05-26T21:03:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agenciafxsoluciones](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/agenciafxsoluciones/32/18360_2.png) [@agenciafxsoluciones](https://forum.wixstudio.com/u/agenciafxsoluciones)\
**Post date:** [May 26, 2020, 9:03pm UTC](https://forum.wixstudio.com/t/users-edit-his-own-entry-on-a-database/20937/1 "2020-05-26T21:03:01Z")

</div>

Hi! First of all, sorry for my bad english, I’m not a native speaker.  
What I have?

- Wix members area

- Dynamic pages for members ID

- Database for users data

- One page on the members pages section to submit the data

- One page on the member pages section to show the data that they already submit

What I want?

- I want the users can edit later the data they submit

What’s the problem?

- When users submit data successfully, they create a new entry on the daabase, when they try to edit the data, they end creating a new entry on the database

I hope you can help me, I already search everywehre and try everything, even I see people on youtube searching for the same answer.

Some captures:

 ![](https://us1.discourse-cdn.com/wix/original/3X/a/1/a160f12291a8aaa4b5e2fa132a4a546a16c5db29.png)  
I have this code, this way the users can access to a dynamic pages exclusives for him.

 ![](https://us1.discourse-cdn.com/wix/original/3X/b/d/bd605ec2a26ac224cf249e0c011e49d64666da31.png)  
The page on members area to show the users data they already submit.

 ![](https://us1.discourse-cdn.com/wix/original/3X/5/a/5aa1be096535cb7902b18f91def41e9c8e826e35.png)  
A lightbox for the users to submit his information.

---

<div class="post-metadata">

**Author:** ![samuele](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/samuele/32/10102_2.png) [@samuele](https://forum.wixstudio.com/u/samuele)\
**Post date:** [May 28, 2020, 2:02pm UTC](https://forum.wixstudio.com/t/users-edit-his-own-entry-on-a-database/20937/2 "2020-05-28T14:02:37Z")

</div>

Hello.

You can try the following:  
Get the item being edited using [getCurrentItem()](https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem) ;  
Use [update()](https://www.wix.com/corvid/reference/wix-data.html#update) method to submit changes to the database collection.

The ID field is very important in this case and can be accessed as shown below:

```javascript
let itemID = $w("#myDataset").getCurrentItem()._id;

```

Click here to learn more about working with the data API.

Good luck!

---

<div class="post-metadata">

**Author:** ![agenciafxsoluciones](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/agenciafxsoluciones/32/18360_2.png) [@agenciafxsoluciones](https://forum.wixstudio.com/u/agenciafxsoluciones)\
**Post date:** [June 2, 2020, 9:24pm UTC](https://forum.wixstudio.com/t/users-edit-his-own-entry-on-a-database/20937/3 "2020-06-02T21:24:15Z")

</div>

Hi! Thanks for your answer. I already solve this without code, On the “Update information” lightbox, set the dataset as read and write, and filter the data to show only owner.
