Data Prep mapping functions not working!!
str_to_object()
json_to_object()
I have a CSV file and am using "Map CSV to XDM schema" in the UI. After uploading the file with | as the delimiter, I used the function json_to_object(commerce.order._myNameSpace.customerDetails).firstName in the "calculated field" during mapping. I then mapped it to the corresponding string field in the schema.
However, the json_to_object function always failed and returned null in the dataset.
Next, I tried using the str_to_object function after modifying the string format in the CSV. I used str_to_object(commerce.order._myNameSpace.customerDetails,":",",").get("firstName") but it still didn't work and also returned null.
Any ideas why the functions never worked???? Thanks.
The functions doc:
_id|commerce.order._myNameSpace.customerDetails|commerce.order._myNameSpace.acc_order_id|commerce.order._myNameSpace.orderInvoiced_retRef|commerce.order.cancelDate|commerce.order.createdDate|commerce.order.refundTotal|commerce.order.taxAmount|eventType|personalEmail.address|producedBy|timestamp|_myNameSpace.customConfiguration
123456789|{"firstName":"Myfirstname","lastName":"MyLastName"}|123456778|Ref666|2018-11-12T20:20:39+00:00|2018-11-12T20:20:39+00:00|3812.2|29669.24|uploaded.manualy|MyFirstName.MyLastName@gmail.com|self|2025-07-24T20:22:40+00:00|{"firstName":"MyFirstName","lastName":"MyLastName"}
