Linking A Button To Dynamic Page Through Code

Hai Dara,
I know to create the wixlocation to function. But I couldn’t navigate to the dynamic page.
I don’t know the code

import wixLocation from ‘wix-location’;

wixLocation.to(dynamicpage + fullname);

My dynamic page’is id is userprofilepage/fullName // field from database

Aim → Make a query that matches the current userid to the databse UserProfileData and get the user dynamic link and navigate that user to that link.

Thanks,
Ajith