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

What if No input is coming to Mapper

SandeepVemula
Contributor

I have a mapper and I have a expression as below

$.hasOwnProperty(โ€˜queryโ€™) ? $query : โ€˜not present in inputโ€™

The expression is working fine if input comes to mapper. But if there is no input/input doest contain query it should return โ€˜not present in inputโ€™. โ€˜not present in inputโ€™ is coming if input doesnt contain query. This should work if no input is passed to Mapper right. If that is not the case how can I overcome If no input is passed to mapper.

Tried โ€œsnap.in.totalCountโ€ also. No result.

1 ACCEPTED SOLUTION

brettdorsey
New Contributor III

Sandeep,

Many snaps will do nothing if there is no input at all from a previous snap. In order to get around this, you can create a JSON Generator to produce a dummy document and merge it with your normal input using the JOIN snap. Check the link below for an example.

View solution in original post

2 REPLIES 2

brettdorsey
New Contributor III

Sandeep,

Many snaps will do nothing if there is no input at all from a previous snap. In order to get around this, you can create a JSON Generator to produce a dummy document and merge it with your normal input using the JOIN snap. Check the link below for an example.

SandeepVemula
Contributor

@brettdorsey, Got your point and Implemented the sameโ€ฆ