cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

To delete a field

manohar
Contributor

hi there, i have a simple json from which i am trying to delete field Attachements. sometimes it can come as array and sometimes not. please see my mapping in the attached pipeline. for somereason it complains the field doesnt exist.

Any pointer on whats happening.

Thanks
Manohar
to delete field_2022_11_05.slp (13.2 KB)

2 REPLIES 2

del
Contributor III

@manohar,

This post looks like a follow-up to your other post Ignore mapping if empty.

Try the attached pipeline to help your use case. With a modification to your pipeline, this one replaces your mapper with one that uses the object.filter() method of SnapLogicโ€™s expression language and simply deletes the โ€œattachmentsโ€ key while leaving the remainder of the object as-is, and is not impacted if โ€œattachmentsโ€ is not in the object.

Community.13788.v1.slp (7.6 KB)

manohar
Contributor

thanks @del. my requirement changed slightly so wanted to start fresh.

but this is what I was looking for. appreciate your help.