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


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?

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

Are you using quotes around the field name, like this?

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

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

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

Use the </> icon in the editor to post JSON.

Sure, I will attach screenshots to this response. Please see below;

Error from within the problematic snap after drag and drop:

pipeline overview:

You’re not showing us the input data but the error message means that the TAIX-POL field does not exist in some of the input documents. Try either the expression it’s recommending, $.get('TAIX-POL') or avoid the issue more generally by checking the “Null-safe access” box at the top of the Mapper.

1 Like