Adding a button link with a URL+variable

Problem: Hi, I am wondering, is it possible to add a link from a button that is part URL/part variable, for example

https://www.demowebsite.co.uk/?query=XXXXX

I want to replace XXXXX with the content of a variable which is a unique 5 digit code, meaning the website will search for that variable in its database. I thought I might be able to do it by cooncating a variable but I’m struggling to get it to work. Is this at all possible? Doing it this way will save me entering the link 300+ times!

ActivePresenter version: 10

OS: Mac

Notes: N/A

Thanks in advance

Here is how I would concatenate some text with a variable.

In this example I am simply concatenating to create the name of multiple states for an object such as shape1, shape2, shape3, etc where the variable represents the number after the word shape.

prez.object("myBox").state("shape"+prez.variable("myVar"));

I believe your example fits the scenario above.

If it still does not work - perhaps there is a need to deal with the special characters in the URL.

Hope this helps.

How about something like this…

Would this work for you if you placed in on a button and created the two variables in AP?
(code and newLink)

let linkRoot = "https://www.demowebsite.co.uk/?query=";
prez.variable("newLink", linkRoot + prez.variable("code"));

window.open(prez.variable("newLink"), "_blank");

You would have to determine how that code is being generated.