with this object
payload = {
"person_id": "dd1798",
"medical_claims": [{
"revenue_code_descriptions": ['something', 'else']
}],
"json_create_date": "2016-09-19"
};
Gives
medicalClaims:[revenue_code_descriptions:"something"]
instead of
medicalClaims:[revenue_code_descriptions:["something","else"]]
But if that array was on the top level, then you would get what you would expect
payload = {
"revenue_code_descriptions": ['something', 'else'],
"json_create_date": "2016-09-19"
};
map = {
'revenue_code_descriptions':'revenueCodeDescriptions'}
result
{
revenue_code_descriptions:["something","else"],
"
var payload = {
"medical_claims": [{
"revenue_code_descriptions": ['something', 'else']
}, {
"revenue_code_descriptions": []
}]
};
should have a destination with
{
"medical_claims": [{
"revenue_code_descriptions": ['something', 'else']
}, {
"revenue_code_descriptions": []
}]
};
Hi @wankdanker_twitter , I'm currently exploring this tool and it seems quite cool.
One thing I wanted to confirm, which i couldn't completely understand from the documentation. Is there a way to create a new key in the destination object with a value that is calculated based on multiple keys in the source object?
for example if i have the source object:
{a:"true",b:"false",c:"true"}
can i get a destination object {d:"true"}
based on a transformation logic such as if(a=="true" && b=="false" && c=="true"){return "true"}
something to that effect.
I ended up accessing the source properties from the fromObject being passed into the transform function as in the below map:
var map = {
'd': {
key: 'a',
transform: function (value, fromObject, toObject, fromKey, toKey) {
if(fromObject.a==="true" && fromObject.b==="false" && fromObject.c==="true") {
return "false";
}
return "true";
}
}
};