10-20-2022 10:50 PM
hi there,
how can I ignore the mapping if I am not getting any values? example in the below screenshot for the record, there’s no attachment so mapping should not happen. for this example since no attachement its failing in the downstream snaps.
Thanks
Manohar
10-25-2022 11:09 PM
Hi @manohar
I think it’s possible in a mapper snap with this expression and as target path nothing.
I had this question also before to delete the fields that are empty and had this solution below
Expression: jsonPath($,“$…[?(value == {}) ]”)
The expressions checks the paths if they are null and then delete them if so. After that you need a next mapper snap that checks all the fields of null values and delete them.
Example in the pipeline with mapper snap below
The reason for two snaps is I think that you first need to check the values inside the array and after that you can check the higher parent for null values. I think you will understand if you check the pipeline.
If there is a more efficient way I am happy to hear.
Test_Pip_V1.3_2022_10_26 (1).slp (6.2 KB)
10-26-2022 03:46 AM
Thanks @JensDeveloper if I go with that, then it would drop other required fields, although they are null. so it’s just some fields like the attachment (as it’s actually a related record) need to be dropped.
Thanks
Manohar
10-26-2022 11:31 PM
Hi @manohar ,
As I wrote in my post above, you can use the Router and proper mappings after them.
10-26-2022 09:50 AM
You can directly replace Copy + Filters with a Router. You can accomplish this by updating the expression in the Mapper(Filter) snap. Check pipeline below:
mytransformation_2022_10_26.slp (69.8 KB)
I would recommend the router version with proper mappings afterwards.
Regards