A query string is a part of a uniform resource locator that assigns values to specified parameters. Query strings include fields added to a base URL by Web browsers or other client applications in Sap Analytics Cloud.
Follow the below steps to create parameters and use:-
Access Parameter Value
- Create new Script Variable from components, give script name (ex. username). and check the checkbox for Expose variable via URL parameter
2. Print username variable anywhere in your application, for example create new button and add this code.if(username===""){ Application.showMessage(ApplicationMessageType.Warning, "Username is blank"); } else { Application.showMessage(ApplicationMessageType.Success, "Username is "+username); }
The parameter access has been created, so now when you create a username parameter, the parameter value will be passed to the username variable.
Create Parameter
To create parameter you no need to write any code, you can just simple pass variable name in parameter with “p_” prefix. for example your variable name is username then your have to pass parameter in URL like p_username=Rohit.
Ex:-
https://xxx.cloud.sap/sap/fpa/ui/tenants/f67a9/app.html#/analyticapp&/aa/XXXX/?p_username=Rohit
Another why you can use NavigationUtils function, see example below:-
NavigationUtils.createApplicationUrl("APP_ID", UrlParameter.create("p_username","Rohit"));
//it will create and return url with parameter
Now when you click on button, you will get alert with username value.
Conclusion
Therefore, this article has explained how to create and use parameters in an analytical application, making it a lot easier to pass values from another source application to another target application.