Groovy Script
Explanation
This script:- JSON Parse Operation: Parses the incoming response (
responseBodyTextToClient) in JSON format. - Mask Function: Masks the middle characters with
*while preserving the first and last characters of the given string. - Data Processing: Loops through the
dataarray in JSON and masks theADI,SOYADI, andNUMARAfields of each element. - Result: Converts the processed JSON back to string format and returns it as a response.
This script should be run on the response line (Response Policy) because it uses the
responseBodyTextToClient variable.
