UI-Template URL Button With Changing URL

I'm trying to create a button using the UI-Template node that will open a new window using Google's Query URL. However, the URL is constantly updating based on the global variables that are in my flows. Is there any way I can create a button on the dashboard that constantly adapts to the new URL?

Here's part of my flow:

[{"id":"f48f1a39.a3ea08","type":"inject","z":"463ea969.55fbc8","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":1860,"wires":[["bf212998.193f38"]]},{"id":"bf212998.193f38","type":"function","z":"463ea969.55fbc8","name":"URL Launcher","func":"var lat = global.get(\"latitude\");\nvar lon = global.get(\"longitude\");\n\nmsg.payload = \"https://www.google.com/maps/search/?api=1&query=\" + lat + \",\" + lon;\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":1820,"wires":[["3574826b.b4665e"]]},{"id":"3574826b.b4665e","type":"ui_template","z":"463ea969.55fbc8","group":"8bc5fb43.adc908","name":"","order":2,"width":0,"height":0,"format":"<script>\nvar lat = global.get(\"latitude\");\nvar lon = global.get(\"longitude\");\nString url = msg.payload;\nfunction yeet(){\nwindow.location.href = url;\n}\n</script>\n\n<button onclick=\"yeet()\">config</button>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":460,"y":1840,"wires":[["11de1efa.7bdcb1"]]},{"id":"8bc5fb43.adc908","type":"ui_group","z":"","name":"Activity Log","tab":"9cd1808f.a7259","disp":true,"width":"6","collapse":false},{"id":"9cd1808f.a7259","type":"ui_tab","z":"","name":"EARS","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Also, if it's possible to configure the button so that it has the same color scheme as the dashboard buttons, can you show me how to do that as well?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.