Forum Discussion

Arijit's avatar
Arijit
New Contributor
2 years ago

Error in the Snaplogic Mapper for excel Merged fields

I am trying to process a excel file using Excel parser and on the mapper we want to pull the previous not null value for a field if the value of the field is null for which have tried the below expressions but snaplogic is giving error .

option 1 :

$Value == null ? $Value.substring(0, $Value.length() - 1) : $Value

option 2 :

$Value == null ? $previous.Value : $Value

Error :

Failure: Expression worked for 1 previous document, but failed on document #2 with the error: $previous is undefined. Perhaps you meant: $B, $Label, $Value, Reason: 'previous' was not found while evaluating the sub-expression '$previous', Resolution: Check the spelling of the property or, if the property is optional, use the get() method (e.g. $.get('previous'))

The Excel file that I am trying to process has the rows as below :