on 2024 Sep 17 10:17 PM
Greetings,
How do I access the URL parameters inside the Screen Personas flavor?
The goal is to call a flavor by the URL while including some additional values as parameters.
The parameters come back empty when using plain JavaScript, and I don't see any references to the URL parameters from any of the Screen Personas scripting objects.
Personas version 3.17
I saw this thread, but found no solution:
https://community.sap.com/t5/technology-q-a/how-to-access-browser-url-parameters-in-personas-flavor-...
Thank you
Request clarification before answering.
Yes,
SAP Screen Personas scripting doesn't have any objects to operate with URL.
BUT you can use Javascript and window object to retrieve needed parameter.
Try this:
/* globals console, window, URLSearchParams */
const params = new URLSearchParams(window.location.search);
console.log(params.get('sap-theme'));
If this doesn't work for you, search similar solution.
Best Regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that screenshot. I've tested with the latest version of Chrome and Edge, so not sure what is happening. For comparison, I created a basic HTML file with the JavaScript and it worked successfully, the parameters are fully visible. On the Personas page, the window.location.href string ends with 'personas#'.
User | Count |
---|---|
84 | |
29 | |
9 | |
9 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.