How to let user submit an item on database but limited to only 1 row per user

Hi, I am building a private database per registered user. Each user can create their own user data that is tagged to their IDcard number.

It works that each user can create their own line when they submit. But I need this to be limited to only one row per person.

The problem is when they enter a new IDcard number, it creates another one.

The same when they enter other column data, instead of updating it, it create new row for that data.

Help !!

You can set the _id field to be the _id of the collection record.
If you use a dataset, use setFieldValue(‘_id’, userId ) . See here .

put all the fields in infoObject, the:

infoObject._id = userId;
wixData.save('CollectionName', infoObject), 

@J.D.
I think, althoug your provided tip is good, it won’t be enough info for the post-opener, to get it to work. But i am curious!

There is still a little → but ! ← Another aspect, which won’t let the given code working, like expected (even if the code is completed), if the Submissin-Button…and if a dataset…???

Let’s take a look if the post-opener can complete the question.
Completed-Question = Answer :wink:

I solved this using Hook and using noduplicates tagging to the Owner :slight_smile: so proud of myself

Well done! Going own ways always good! → Creating own coding style!

1 Like

@russian-dima thank youu !! :heart::heart:

1 Like

Hope my simple solution will help
others. Spread goodness !