Target path based on Mapper expression condition

How to change the Target path based on the Mapper Expression.

On the source file the Column name can be either Overall Manpower(FTE) or Overall Resources(FTE).
In the mapper table expression builder I am using the below Expression.

$input0.findIndex(x=>x.O == “Overall Manpower (FTE)”) || $input0.findIndex(x=>x.O == “Overall Resources (FTE)”)

On the Target Path can i use two different targets e.g., $ConstructionOverallManpowerFTERow || $ConstructionOverallResourcesFTERow

I even tried conditional snap but got an error.

Please suggest the possible solution.

Cheers
Vinny

Hi @UrsVinny,

You can try using Mapper with Null-Safe access on,

And after this Mapper use another one that will filter null value from the root object.

Example Input:
image

Example Output:
image

Let me know if this helps you.

BR,
Aleksandar.

Thanks Aleksandar!
Will try and let you know.

Thanks once again.

1 Like