
In this blog, I will show you how to link a value in a graph with the generation of an eMail, passing through a parameter.
1 - Step one : Create your graph
In my example, I created a simple graph with an Employee name, and a value. In my example I am a middle-manager, that needs to make sure that all employees have fulfilled their mandatory trainings :
The graph contains 1 dimension, 1 measure.
2- Step two : Create a script
Now, clickon the 3 dots on the right hand corner of the graph : ...
Navigate to Edit Scripts > onSelect to open the script generation page.
In this page, you simply need to leverage the following code :
// Chart_42 is the name of the chart in the document
// %0A is the HTML for line break
var selection = Chart_42.getSelections();
var email = "mailto:" + selection[0]["Employee_Name"] + "@bestrunbikes.com?subject=Please follow the mandatory trainings&body=You have overdue mandatory trainings. %0A Please do them as soon as possible. %0A Regards, %0A Top Management";
NavigationUtils.openUrl(email);
First variable : selection, I retrieve the selected value of the graph (in my example my graph is called "Graph_42".
Then I create a variable called "email" that contains the html code to send an email. For more details on eMail HTML code, you can check this article : https://yoast.com/developer-blog/guide-mailto-links/
Once this is done, you need to PReview your document as scripting is not executed in Edit nor View mode
If you want to have more great easy scripting hints, do not hesitate to follow Daniel Davis introduction to scripting : https://community.sap.com/t5/technology-blogs-by-sap/start-your-scripting-journey-the-easy-way-with-...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
33 | |
12 | |
12 | |
11 | |
11 | |
10 | |
8 | |
8 | |
7 | |
7 |