Mask a JSON field in a SQL Server database
search cancel

Mask a JSON field in a SQL Server database

book

Article ID: 383216

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

The JSON is the following (formatted for better reading, but it is compressed in the SQL SERVER DB)

{
    "employes":[
        {"nom":"Nom1","prenom":"Prenom1","ddn":"1980-01-01","emploi":"emploi1"},
        {"nom":"Nom2","prenom":"Prenom2","ddn":"1990-01-01","emploi":"emploi2"},
        {"nom":"Nom3","prenom":"Prenom3", "ddn":"1960-01-01", "emploi":"emploi3"}
    ]
}

I am trying to mask only $.employes.nom using formatFPE1 and have entered the following values in the XPATH field :

  • $["employes"]["nom"]
  • $[*]["nom"]
  • $[employes][nom]

 

But unable to get a working masking job. 

Environment

TDM 4.11

Cause

N/A

Resolution

You have to use XPATH field as: $["employes"][*]["nom"]

 

Additional Information

When in doubt, look at the FDM UI to see how the XPATHS are presented