wixLocation.to for dynamic pages with 2 added field

I have a click button code on a non-dynamic page like this:

export function button4_click() {
wixData.query(“Members”)
.eq(“_id”, wixUsers.currentUser.id)
.isEmpty(“category”)
.count()
.then( (num) => {
if (num === 1) {
wixWindow.openLightbox(“warningcategory”);}
if (num === 0) {
wixLocation.to(/Members/{category}/${wixUsers.currentUser.id});
}
});
}

wixLocation.to code is not working, I can not figure out how can I put my “category” field in it. (On my page info I got this url: Members/{category}/{ID} )

Thanks in advance!

Hi,
Can you share a link to the editor so we can inspect your’s site structure ?
Roi.

Hi,
Thanks for your response, I have already change my site a little bit but the know-how still missing to create 2 dynamic page from the same collection and avoid the conflict between them.

Here is the page, on the left I collect the basic member data but I need another for billing infos uses the same “Members” collection to insert.
I would like to separate them or simply create a 2nd dynamic page for billing but then I can not figure out how can I link to this 2nd one.

My page link is: https://wedmet18.wixsite.com/wedmet

Thanks in advance!

Imre