cancel
Showing results for 
Search instead for 
Did you mean: 

Remove obsolete fields from the mapper snap which uses endpoint

svedantam
New Contributor

You have a response from an API endpoint that brings a huge number of fields. There are few obsolete fields that you want to remove in the pipeline. What is the best way to handle this in Mapper snap?
• Add only the fields to be removed from the Input schema and leave the Target Schema as blank with Pass through.
• Add all the required fields from the Input Schema and map to Target Schema
• Add all the required fields from the Input Schema and map to Target Schema with Pass through
• Add the fields to be removed to the Target Schema and pass null values in the Input Schema with Pass through.

2 REPLIES 2

alchemiz
Contributor III

Hi @svedantam,

Good day, you can use the Object filter method

e.g.

$.filter((val,key)=> ['obsolete_field1','obsolete_field2','obsolete_field3','obsolete_field4','obsolete_field5'].indexOf(key) == -1)

Thanks,
MM

svedantam
New Contributor

Thanks alchemiz