cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter instances using mapping root

wcl3y2
New Contributor III

I want to set my mapping root on an array of objects, but I only want to pull back a subset of the objects based on one of the object properties. Is there any way to do this in the mapping root?

4 REPLIES 4

ptaylor
Employee
Employee

wcl3y2
New Contributor III

Thanks for the suggestion. I can do that, but I want the rest of the objects that are filtered out to be included in the end result untouched. I was hoping that I could just filter the ones I need to change in the mapping root with one snap instead of multiple.

Ok, so you want all the elements of the array in the result, not a subset, right? So in your Mapper with the Mapping Root Set, you could make every expression conditional:

condition ? (value-if-true) : (value-if-false)

wcl3y2
New Contributor III

Thanks for the help!