Share this page

# 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.

https://admhelp.microfocus.com PPM 8942
Tips to improve your search results... OpenText™ Project and Portfolio Management Help Center PPM Help 26.2-26.3 All View Local Help Center View Online Help Center Version: