If you have a button inside a repeater you can set the link of all the items under the dataset ready function like this:
export function dataset1_ready() {
$w("#repeater1").onItemReady( ($item, itemData, index) => {
$w("#repeater1").forEachItem( () => {
$item("#myButton").link = `https://www.mysite.com/page/${$item("#dynamicpage").text}`; //button
});
});
}
then have an onClick for the button:
export function myButton_click(event) {
let $item = $w.at(event.context);
$item("#myButton").target = "_blank";
}
If you don’t have a repeater then use the page’s onReady function to set the link