Help! Userid in dynamic dataset is not matching with collection id, result page not found.

Hello everyone,
I’m struggling to get rid of one issue from last few days … can any one help here, looking forward to hear from admin/ moderator …
Issue:
I have created a signup page which has some field elements and I have connected this page to collection and when submitted this page connects to dynamic page successfully and collection is updated with the records correctly, ID fields in collection is added. Till this everything looks fine…

Now I have created a login page( with username and password) and when successful this page should connect to already created dynamic page( as mentioned above) using wix location

wixLocation.to(/collection1/update/${wixUsers.currentUser.id});

Id assigned to current user is not matching with the id field as specified in the Collection column hence the result is “404 - Page not found”

I tried everything but issue is not resolved, can anyone help me here.

As Heath says, you are using this tutorial which you need to follow carefully.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

If you are struggling with it then watch Nayeli (Code Queen) old youtube guide for it.
https://www.youtube.com/watch?v=Orl8GJNzG5s

Just remember that as the tutorial says, you are creating your own separate members dataset of which is only filled in when the user has signed into your site as a site member and can access their profile to add or edit whatever is on your profile user input form.

All additions and changes that the user makes to their own unique profile page on the update profile page will be saved into the Members dataset.

You will still need to use Wix default or custom login/signup forms or your own custom login/signup lightboxes using the register and login functions.
https://www.wix.com/corvid/reference/wix-users.html#login
https://www.wix.com/corvid/reference/wix-users-backend.html#login
https://www.wix.com/corvid/reference/wix-users.html#register
https://www.wix.com/corvid/reference/wix-users-backend.html#register

Also remember that this users Wix Users and can’t be tested through preview, it needs to be tested in the live mode.

The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

Plus. also note that each profile and update profile page is unique to the site member with that id, so if you are not that user you will not have correct permissions to view it.

Finally, note that you are directing the user to the update profile page.
wixLocation.to(/collection1/update/${wixUsers.currentUser.id});

You are better off directing the user to their profile page only.
wixLocation.to(/collection1/${wixUsers.currentUser.id});

As stated in the tutorial itself.

When the profile button is clicked, we use an event handler to send members to their personal profile page.
We add an event handler by selecting the profile button and we use the Properties panel to add a handler for the onClick event.

Then we add the event handler code, which looks like this:

export function profileButton_click(event) {
  wixLocation.to(`/Members/${wixUsers.currentUser.id}`); 
}