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-21-2022 04:13 AM
Is it possible to show in a mapper how it should look like. I exported the mapper portion of my pipeline.
mytransformation_2022_10_21 (1).slp (68.3 KB)
Thanks
Manohar
10-21-2022 08:32 AM
@bojanvelevski @marjan.karafiloski , wondering if you have any pointers based on how my input is?
Thanks for you help,
Manohar
10-25-2022 01:13 AM
Hi @manohar ,
You can also use Router snap, where you will check if there is attachment, like:
$attachments.get(‘attachment’) != null
After that, you can use two different mappers, one without the attachment and one with it.
BR,
Marjan
10-25-2022 04:12 AM
You cannot impact the attachments array directly in one mapper, since you have another mappings happening on the same level in the target object.
What you can do though, is add another Mapper that will serve as a filter. The mapper uses the Mapping root to go down to the attachment object and filter out the “type”,“text” and “intent” fields if they are null.
mytransformation_2022_10_25.slp (69.7 KB)
Let me know if this helps,
Bojan.
10-25-2022 06:05 AM
Thanks @bojanvelevski wondering how can I remove “attachments” node as well, if they are coming as null.
I went with this solution for now but trying to reduce no. of snaps to get to that
Thanks
Manohar