After registration to direct the user to his dynamic site (resolved)

I have created a form for user registration but I want users after registration to go to their dynamic page to be able to access their data I have tried many times but to no avail everything I see is
(There’s Nothing Here. …
We can’t find the page you’re looking for.
Check the URL, or head back home.)

I also tried

w i x L o c a t i o n . t o ( / . .. / $ { w i x U s e r s . c u r r en tU ser. id } ) ;


no result


this is a cod I am using now

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
import wixData from 'wix-data';
let registration;

$w.onReady(function () {

 $w("#registrationButton").onClick((event) => {
  console.log("Button was clicked"); //You can change the text of this line or delete it
  $w('#errorMessage').hide(); //We want to hide all error messages when the person attempts to register again
  $w('#emailExists').hide(); //We want to hide all error messages when the person attempts to register again
 if ($w("#email").valid && $w("#password").valid && $w("#firstName").valid && $w("#lastName").valid) {
 let email = $w("#email").value;
 let password = $w("#password").value;
 let first = $w("#firstName").value;
 let last = $w("#lastName").value;

   wixUsers.register(email, password, {
     contactInfo: {
 "firstName": first,
 "lastName": last
     }
    })
    .then((result) => {
     $w("#dataset1").save()
      .then((item) => {
       wixLocation.to("/"); 
      })
      .catch((err) => {
 let errMsg = err;
      });
    })
    .catch((err) => {
 let errorMsg = err;
     console.log(err);
     $w('#emailExists').show(); 
    });
   console.log("Trying to register"); 
  } else {
   $w('#errorMessage').show(); //
   console.log("Missing information"); /
  }

 });

});

Do you have any idea if any cod works.

First take a look onto the structure of your dynamic-page-url.

  1. https://www.wix.com/velo/reference/wix-location/prefix
  2. https://support.wix.com/en/article/velo-making-dynamic-page-urls-meaningful-with-prefixes

Navigate manually to the users dynamic page and take a look onto the URL.
You can also normaly the the dynamic url in your database related to the dynamic page.

Thank you very much for your answer, I checked all the articles on this issue, even the ones you sent me.

I could easily do the same thing directly with the (register button), but it’s very lacking in some other issues what I want is that when the user presses the button to send the visitor to his dynamic page with some form of code.

Since you are saving the data into the dynamic page, you can go to your database, find the field ID of the prefix (e.g. “link-1-title”)

Then you can use the dynamic page prefix to redirect user.

wixLocation.to(item[link-1-title])

Don’t use item.link-1-title, cuz you cannot select like this.

Thanks for your reply is this what you tried to me

indicate if yes ather for this says (Cannot find name ‘link’.)

or if you can tell me more clearly.

@qlirimhaj
Read this post here: A similar situation to your own.
https://www.wix.com/velo/forum/community-discussion/query-collection-to-navigate-to-dynamic-page

@russian-dima
thank you very much I looked and once what you said
wixLocation.to (article [link-1-title]) and help me a lot

thank you very much. I solved it🤗

Sorry, forgot to add a quote

[“link-member-all”]