Skip to main content

getPiResultValue

getPiResultValue

Reads the value at a specific path from a Provider Instance's last response, inside an onResponseUpdate event.

Parameters

  • piName (String): The Provider Instance name
  • blockPath (String): The path to the value within the response data (e.g. "$.result.code")

Returns: dynamic — the value at that path, or null if the path does not exist

Description

Returns a meaningful value only within the response-handling cycle (onCheckUpdateValid, onResponseUpdateBefore/After, onPushUpdateBefore/After, and so on). The value is held temporarily only while that response is being processed and is discarded as soon as processing ends, so calling it outside that cycle returns null.

It is useful for inspecting the raw response before or after it is applied to the DataSet, or for branching on the response code.

Example

// onResponseUpdateBefore 이벤트에서 응답 코드 확인
var code = $vm.getPiResultValue("orderProvider", "$.result.code");
if (code !== "0000") {
$vm.setCancelData("orderProvider", true);
$log.i("오류 응답, DataSet 반영 취소:", code);
}

Related

  • $vm.setCancelData(piName, isCancelData) — cancel applying a response to the DataSet
  • $vm.evalProviderJsonPath(recvPath, regularPath) — query the current DS with JSONPath