Forum Discussion
endor_force
2 years agoNew Contributor III
You have two approaches, one is to continue on the path with a mapper and javascript methods, but you can use the filter method before map to only include the low risk.
$suppliersRisksResponseFromSupplierSAPI
.filter(x => x.aggregateRiskDetails.riskLevel == "Low Risk")
.map(x => x.riskDetails.supplierLocationStateCode)
The second approach is to use standard snaps to achieve the result, it may look more busy in SL designer but it is adding better readability and flexibility for the future if you want to work with other data from the input.
Attached is a sample, it will output the name of each low risk state as a separate document which you can work with or group as you wish.