Hi Dojo,
I would like to know if it’s possible to have a solution where a single clickable shape can open two (or more) different links at once. I’ve tried using a URL data shape, but it seems that only supports one link. Would this be achievable with an Execute action, or is there another way to redirect and open multiple URLs from one click?
Thanks in advance!
Hi Yahya,
Natively we do not support providing two links to the Link Shape Data. After all, some browser are not always allowing to do this as far as I remember. Then again, the suggestion of Steve might work because this would be seen as one user action. Tried myself to find a solution and it works. You will have to make a custom HTML file and place this under Webpages (e.g. "C:\Skyline DataMiner\Webpages\myPage").
In your Visio shape you can then do something like this: https://<DMAIP>/myPage?urls=https://www.npmjs.com/,https://www.google.com
html page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redirect</title>
<script>
function getUrlsFromQuery() {
const params = new URLSearchParams(window.location.search);
const urlsParam = params.get("urls");
if (!urlsParam) return [];
return urlsParam.split(",").map(u => u.trim()).filter(u => u.length > 0);
}
function openAndClose() {
const urls = getUrlsFromQuery();
urls.forEach(url => {
window.open(url, "_blank");
});
// Close this helper page (may require user permission depending on browser)
window.close();
}
window.onload = openAndClose;
</script>
</head>
<body>
</body>
</html>

Hi YahYa,
I do not believe we can directly support what you are looking for. This Dojo Questions explains more: LCA : Web component - Custom HTML and JavaScript - DataMiner Dojo
If you are able to follow this Custom HTML approach and create a custom web page, the following JacaScript HTML should work for you:
<!DOCTYPE html> <html> <head> <title>Open Multiple Links</title> <script> function openMultipleLinks() { window.open('https://www.google.com', '_blank'); window.open('https://www.youtube.com', '_blank'); window.open('https://www.wikipedia.org', '_blank'); } </script> </head> <body> <button onclick="openMultipleLinks()">Open Multiple Websites</button> </body> </html>
Thanks Jarno & Steve for your response, it worked on my end as well.