04-08-2024 05:09 PM
IF riskLevel=="Low Risk"
then move rd.sc to new array. How can I can accomplish this please?
Solved! Go to Solution.
04-09-2024 11:52 PM
Hi @aakumar,
The map() method is an iterative method and returns a new array with the values transformed by the given callback.
The current expression constructs a new array containing an object, where the object's property value is assigned the value of "rd.sc".
I have updated the expression to be more descriptive:
$SRSAPI.filter(f=>f.agrDetails.riskLevel == "Low Risk").map(element=>{"rd":{"sc":element.rd.sc}})
BR.
Ivica
04-10-2024 05:44 AM
Got it, appreciate you for taking the time to explain it to me. Thanks.
04-09-2024 12:33 AM
Hi @aakumar ,
Please look at the attached pipeline.
Hope this helps!
BR.
Ivica
04-09-2024 09:44 AM
Great solution. Thank you.
But, I don't understand the Expression, it seems very complex.....
$SRSAPI.filter(f=>f.agrDetails.riskLevel == "Low Risk").map(x=>{rd:{sc:x.rd.sc}})
I understand the filter. Could you please explain what is happening with the .map?
04-09-2024 11:52 PM
Hi @aakumar,
The map() method is an iterative method and returns a new array with the values transformed by the given callback.
The current expression constructs a new array containing an object, where the object's property value is assigned the value of "rd.sc".
I have updated the expression to be more descriptive:
$SRSAPI.filter(f=>f.agrDetails.riskLevel == "Low Risk").map(element=>{"rd":{"sc":element.rd.sc}})
BR.
Ivica
04-10-2024 05:44 AM
Got it, appreciate you for taking the time to explain it to me. Thanks.