Changing button href link based on url parameters

Hi,
I’m trying to create a button with a link (href) that will be modified based on url parameters.
To be precise I have this link:

/users/XXX/seller_dashboard

And I need the “XXX” to changed based on the url parameter “?username=YYY” I’m passing to the landing page.

In addition I also need to create a fallback option if this parameter will be missing, so I’ll be able to send the user to the homepage or something.

This is the page in question: “Builder.io: Drag & Drop Headless CMS

Thanks
David