Test Data Manager

Expand all | Collapse all

How can I avoid that double quotes are escaped with '\' when FDM updates the column?

  • 1.  How can I avoid that double quotes are escaped with '\' when FDM updates the column?

    Posted 10-12-2018 10:10 AM

    I have to mask in a column that contains a json document:

     

    {"x":[5,3],"unit":"Nm","unitY":"Upm","blocks":[{"y":5,"values":[1,2]},{"y":4,"values":[9,4]}]}

    I need to replace all numbers in the "blocks" section with random values, so I use the PARTMASK function with parameter n with the json path $['blocks'] (from the dropdown list), which is in my example

    [{"y":5,"values":[1,2]},{"y":4,"values":[9,4]}]

    and is converted to

    [{"y":4,"values":[3,3]},{"y":3,"values":[7,6]}]

    what is also reflected in the audit log:

    MASKING STARTED AT: 2018.10.12 15:49:41.928 MESZ
    MASKING DATABASE USER: sa
    OPERATING SYSTEM USER: jens
    MAPPING FILE ARCHIVED AS: C:/Users/jens/AppData/Roaming/Grid-Tools/FastDataMasker/backups/jsontest.20181012154941.csv
    OPTIONS:
    AUDIT=ALL
    AUDITFILE=jsontest.csv
    DIAGLEVEL=2
    TABLE,UNIQUE COLUMNS, UNIQUE COLUMN VALUES, MASK COLUMN,PATH,FUNCTION, OLDVALUE,NEWVALUE
    JSONTEST,,,JSONDOC,$['blocks'],"PARTMASK","[{"y":5,"values":[1,2]},{"y":4,"values":[9,4]}]","[{"y":4,"values":[3,3]},{"y":3,"values":[7,6]}]"

    Exactly the result I was looking for.

    But when I select the result from the DB I get:

    {"x":[5,3],"unit":"Nm","unitY":"Upm","blocks":"[{\"y\":4,\"values\":[3,3]},{\"y\":3,\"values\":[7,6]}]"} 

    All double quotes from the replaced json section are escaped with a '\'.

     

    Any ideas how I can avoid this?

     

    Jens



  • 2.  Re: How can I avoid that double quotes are escaped with '\' when FDM updates the column?

    Posted 10-16-2018 12:01 PM

    Hi Jens,

    Let me take this and review with our team(s ) and we'll get back to you as quickly as possible.

     

    Thanks,

    Ryan



  • 3.  Re: How can I avoid that double quotes are escaped with '\' when FDM updates the column?

    Posted 10-17-2018 08:24 AM

    Hi Jens,

    What RDMS?

    Might be best to run a post Masking function to replace all the "\" with an "=" (or other) , or back to original format.



  • 4.  Re: How can I avoid that double quotes are escaped with '\' when FDM updates the column?

    Posted 10-18-2018 07:34 AM

    Hi Ryan,

     

    we reproduced the behavior with MSSQL (with TDM 4.5) and PostgreSQL (with TDM 4.6).

    For both we have invalid Json documents after the masking.

    How can we have a Post Masking Function in FDM?