// Communication details
var ScenarioName = "CommJobScore";
var ServiceName = "Rest_jobScore";
var HttpMethod = "GET";
var HttpResource = "<HttpResource>";
var HeaderParameter : collectionof NameAndValue;
var HeaderParameterEntry : NameAndValue;
var ContentType = ""; // not required for this example
var Body = ""; // not required for this example
HeaderParameterEntry.Name = "apikey";
HeaderParameterEntry.Value = "&JOBSCORE_APIKEY&";
HeaderParameter.Add(HeaderParameterEntry);
// Set URL Parameter
var URLParameter : collectionof NameAndValue;
var URLParameterEntry : NameAndValue;
var result = WebServiceUtilities.ExecuteRESTService(ScenarioName, ServiceName, HttpMethod, HttpResource, URLParameter, HeaderParameter, "application/json", Body);
var JsonString = result.Content;
var jsonValid = Json.IsValidJson(JsonString);
var Result : JsonResult;
var keys : collectionof LANGUAGEINDEPENDENT_EXTENDED_Text;
var key ;
key = "feedback.satisfaction";//full path of key needs to be specified here from the JSON extracted from REST service
keys.Add(key);
Result = Json.ParseKeyValues(keys, JsonString);
foreach(var res in Result.KeyValue)
{
this.GetFirst().ZCOD_Job_Score = res.Value;
}
<!DOCTYPE html><html>
<head>
<style>
span.a {
display: block;
}
span.b {
display: inline-block;
width: 120px;
height: 120px;
padding: 10px;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.19);
background-color: white;
}
</style>
</head>
<body>
<span class="a">
<div style="font-family:'Arial';font-size: 14px;">
<span class="b">Number of Calls<br><br><br><br><b><p style="color: orange;font-size: 24px;"><script>document.write(sap.byd.ui.mashup.context.inport.JobScore);</script></p> </b></span>
<span class="b">Rant Rave Scores<br><br><br><br><b><p style="color: green;font-size: 24px;">10</p></b></span>
<span class="b">Contacted customer last<br><br><br><br><br> Alan Heald</span>
<span class= "b">Quick Notes in SAP Production<br><br>Spoke to customer, job is going ahead tommorow<br><br></span>
</div><br>
<div style="font-family:'Arial';font-size: 14px;">
<span class="b">Track my job score<br><br><br><br><b><p style="color: orange;font-size: 24px;">7</p></b></span>
<span class="b">Repeat contact over last 6 months<br>/30days<br><br><b><p style="color: grey;font-size: 24px;">3</p></b></span>
<span class="b">DG7 complaints<br><p style="color: grey;font-size: 10.7px;">Ticket No:123456</p><br><br><br><br></span>
<span class= "b">Raise a new task in SAP<br><br><br><br><br><br></span>
</div>
</span>
</body>
</html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |