ksc_escape_json

Use this command in report command steps to escape special characters such as quotes and backslashes in a string, enuring it is properly encoded for use in a JSON structure. This is useful when dynamically building JSON content, such as Card JSON values, where proper escaping is required to avoid formatting issues.

Syntax

Copy code
ksc_escape_json <OUTPUT_VARIABLE>="string_to_escape"

Parameters

  • <output_variable>: The name of the output environment that stores the escaped string.
  • <sting_to_escape>: The original string to be escaped for safe JSON inclusion.

Example

To include the request description in a JSON value:

Copy code
ksc_escape_json DET_DESC="[REQ=\"[P.P_ID]\".DESCRIPTION]"

This command retrieves the description of the request identified by [P.P_ID], escapes it, and stores it in the DET_DESC variable for use in your JSON content.