Forum Discussion

sjakathi's avatar
sjakathi
New Contributor II
5 years ago
Solved

How to access a field in Child Pipe Line

Hi,
when I am trying to access Col Desc field in child pipe line getting the below error
sample JSON
{
“Style”:“Pen”,
“Col Desc”: “Black”
}

“failure”: “Validation errors:\nproperty_map.settings.transformations.value.mappingTable.value[4].expression.value: Expression parsing failed near – _content). >> [ << 'Çol Desc (Reason: Mismatched input ‘[’ at line 1:21. Expecting one of: {, ‘||’, ‘&&’, ‘^’, ‘==’, ‘!=’, ‘>’, ‘<’, ‘>=’, ‘<=’, ‘+’, ‘-’, ‘*’, ‘/’, ‘%’, ‘?’, ‘instanceof’, ‘in’, ‘matches’}; Resolution: Please check expression syntax)\n”,

4 Replies

  • cstewart's avatar
    cstewart
    Former Employee

    If you are trying to get the value of something passed to the pipeline in a pipeline parameter, you will have to parse the JSON fiorst, then you can access the field, use an expression like:
    JSON.parse(_content)[‘Col Desc’]

  • sjakathi's avatar
    sjakathi
    New Contributor II

    Thanks For the reply …
    when I am using the JSON.parse(_content)[‘Col Desc’] getting the below error.When I use the suggestion which snaplogic provided(Error Resolution) then the values are coming as null.