You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider that my input data is like below :
var data = {
"balance":{
"amount": 100
},
"disposable":{
"amount":200
}
};
For the above data I want to create template such that it return me an array of balances which consists of objects having two attributes "balancetype" and "amount".
If data has balance then it should return me "balancetype":"interim" and "amount":"balance.amount" and if data has disposable then it should return me "balancetype":"extrim" and "amount":"disposable .amount" .
Note: If data has both balance and disposable then balances array should have two objects and if data has either of balance and disposable then balances array should have one object and if data is not having both of balance and disposable then balances array should not be returned.
Case 1:
var data = {
"name": "khushboo",
"balance":{
"amount": 100
},
"disposable":{
"amount":200
}
};
Hi,
I have a doubt. I am trying to do transformation.
Consider that my input data is like below :
var data = {
"balance":{
"amount": 100
},
"disposable":{
"amount":200
}
};
For the above data I want to create template such that it return me an array of balances which consists of objects having two attributes "balancetype" and "amount".
If data has balance then it should return me "balancetype":"interim" and "amount":"balance.amount" and if data has disposable then it should return me "balancetype":"extrim" and "amount":"disposable .amount" .
Note: If data has both balance and disposable then balances array should have two objects and if data has either of balance and disposable then balances array should have one object and if data is not having both of balance and disposable then balances array should not be returned.
Case 1:
var data = {
"name": "khushboo",
"balance":{
"amount": 100
},
"disposable":{
"amount":200
}
};
Expected Output:
{"balances":[
{ "balancetype":"interim",
"amount": 100
},
{ "balancetype":"extrim",
"amount": 200
}
]
}
Case 2:
var data = {
"name": "khushboo",
"balance":{
"amount": 100
}
};
Expected Output:
{"balances":[
{ "balancetype":"interim",
"amount": 100
}
]
}
Case 2:
var data = {
"name": "khushboo"
};
Expected Output:
{
}
Please help me in providing such a template.
The text was updated successfully, but these errors were encountered: