Forum Discussion

JPaps's avatar
JPaps
New Contributor III
4 years ago

Mapper Snap: Valid Column Names In Input Schema Give "Undefined" Error

Hi,

I am experiencing an issue where I have a Mapper Snap that gives the error: $[FieldName] is undefined when I input a field name in the expression box.

The fields that I am using are inside the input schema of the mapper snap (I have dragged and dropped) so I know that the fields are valid. I have tried refreshing the page, restarting my browser and clearing cache to eliminate the possibility of it being a browser issue.

Does anyone know what could be the cause of this problem?

9 Replies

  • The schema introspection is done on the first document read…Do later documents not have this field present?

    • JPaps's avatar
      JPaps
      New Contributor III

      Thanks for your help, later documents have this field present. I have a fixed width formatter snap in front of the problematic mapper that uses the field. I have noticed that in the mapper, the field name is: $[‘field-name’] (with brackets and quotes) and in the fixed width formatter, the field name is: $field-name (without brackets and quotes). The fixed width formatter snap works (i have confirmed this by running it) but the mapper before it doesn’t. Could this be related to the issue? I will attempt to change the filed names in the mapper to the field without quotes and brackets even though SnapLogic generates the field this way on drag and drop

      • ptaylor's avatar
        ptaylor
        Employee

        Can you capture some sample input to post here, and a snapshot of your snaps configs so we can reproduce what you’re seeing?

  • Are you using quotes around the field name, like this?
    $['FieldName']

    • JPaps's avatar
      JPaps
      New Contributor III

      Thanks for your help.

      Yes, i dragged the field from the input schema and it goes into the expression box with the quotes and brackets but it gives the undefined error

  • WhatIsThis's avatar
    WhatIsThis
    New Contributor II

    Might be that you need to enable Null-safe access checkbox