Configure the rraOrders Action Chain for KPI 1
- Click the Actions tab.
- Click load_KPI_1_data. The Diagram tab opens.
-
In the Actions palette under General, click Call REST and drag it under the Start point and over the + icon, then drop it.
With this configuration method, the failure path for the REST call is automatically handled for you.
-
Configure the call REST action.
- In the Call REST Properties pane, click
Select.
- In the Select Endpoint dialog box, expand Services.
- Expand fscmRest, and then expand rraOrders.
- Select GET /rraOrders.
- Click Select. In the Properties pane, the ID value automatically updates to reflect the selected endpoint.
- In the Call REST Properties pane, click
Select.
- To replace the Call REST action name with a more descriptive title, in the
Label field, enter Fetch All
Orders.
- Replace the default get limit, which is in increments of 25, with a more
reasonable limit for the KPI.
- If not already selected, select Fetch All Orders.
- In the Properties pane, under Input Parameters, click # limit.
- In the Assign Input Parameters dialog box, in the Target panel, select # limit.
- In the # uriParams.limit field at the bottom of the dialog box, enter 1000.
- Select the Static Content option if it isn't
already selected.
- Click Save.
- Configure the success path with the Assign Variables action.
- In the Actions pane, click Assign Variables and
drag it under the success path and over the Return action, then drop it.Note: The Assign Variables action has an error icon and in the Assign Variables properties pane, the error tells you that you need at least one property because you haven't configured any properties yet.
- To replace the Assign Variables action name with a more descriptive
title, in the Properties pane, Label field, enter
Assign Total Number of Orders.
- Next to Variables, click Assign.
- In the Assign Variables dialog box, in the Sources panel under { } callRestGetallRraOrders and { } body. , expand
- In the Target panel, under Page, expand [ ] kpisArray.
- Select { } item[i].
- In the text area at the bottom of the dialog box, under { } $page.variables.kpisArray[0] field, select the Expression option.
- In the Sources panel, click # count and drag it
over the Target panel { } item[i] variable, then
drop it.This expression should appear in the { } $page.variables.kpisArray[0] field. If it doesn't, copy this expression and paste it in the field:
$chain.results.callRestGetallRraOrders.body.count
. - Click Save.
- In the Actions pane, click Assign Variables and
drag it under the success path and over the Return action, then drop it.
- By default, the variable assignment applies to the entire array. Update it to
apply to only the metric of KPI 1.
- On the Actions tab, click Code.
- In the
assignVariablesKpisArray
section, underparameters
, change $page.variables.kpisArray to $page.variables.kpisArray[0].metric.
- To test the action chain, go to the Page Designer tab, and click
Live. Under Total Number of Orders, the --- should be replaced with the number of orders. It takes some time for the information to appear. You might need to refresh the page to get the information to appear.