cancel
Showing results for 
Search instead for 
Did you mean: 

New to Snaplogic Mapper question

bguiliano
New Contributor

Hi, very new to SnapLogic - i built a very simple pipeline to take data from from one server to another.
server1 – Mapper – server2
There is one field in the source database that is too big for the destination database
I was going to take a substring of that field - the code below worked
$FieldName.substring(1,8000)
however, there are null values in the source table.
I tried this - $FieldName.substring(1,8000) ==null?1
but cant get the syntax quite right.
Just looking to take the substring where its not null.

Thanks

1 REPLY 1

koryknick
Employee
Employee

The below ternary (what I believe you are attempting) should work:

$FieldName == null ? null : $FieldName.substring(0,8000)

Or - you could simply enable the “Null-safe access” property on the Mapper snap:
image