cancel
Showing results for 
Search instead for 
Did you mean: 

Mapper help required

yash_verma
New Contributor

Hi team,

How can I dynamically generate the mapper output. scenario is

Name id email
yash 1 Y
suresh 2

in above example email id null for id 2 so I need to create key value accordingly to send to rest api post
for 1st row
{“Name” : “yash”,
“id” : “1” ,
“email” : “Y” }
for 2nd row output shld be

{“Name” : “yash”,
“id” : “1” }

pls help if not in mapper than in which component i can accomplish this

6 REPLIES 6

is this your final out out ?

[{“id”:“1”,“Name”:“Yash”,“email”:“Y”},{“id”:“1”,“Name”:“Yash”},{“id”:“2”,“Name”:"suresh "}]

skatpally
Former Employee

Add the below expression in the mapper

$.hasPath(‘email’) ? $ : $.extend({ ‘email’: ‘’ })

mapper use_2020_10_16.slp (4.8 KB)