Error on dynamic content at Set Variable Activity

Lawrence Borbón 21 Reputation points
2020-05-29T17:17:22.803+00:00

When trying reading the output for a Web Actvity I get the following error message:

{"code":"BadRequest","message":"ErrorCode=InvalidTemplate, ErrorMessage=The expression 'activity('RetrieveRecordCount').output.ADFWebActivityResponseHeaders.Pagination-Page-Count' is not valid: the string character 'P' at position '80' is not expected.\"","target":"pipeline/WunderRestPipelinee75fe7dd-82f6-44d0-8480-5ed305b8dd24/runid/2a04f8b8-a44b-434a-8b1a-83278a58bca2","details":null,"error":null}

The code to access that Header Value is this:
@activity('RetrieveRecordCount').output.ADFWebActivityResponseHeaders.Pagination-Page-Count

I think the problem is that dash sign (-) that is not recognized during parsing.

I was able to read a value from the header that doesn't have the dash sign, so I'm convinced the problem is related to the specific variable name.

Thanks for the help you can provide

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,464 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,011 Reputation points
    2020-05-29T22:05:27.233+00:00

    Hello @Lawrence Borbón and thank you for your question.

    I reproduced your issue with a simple pipeline with 1 parameter (type object), 1 variable ( type string), and 1 Set Variable activity.
    My input parameter is a json object, of value:

    {"propA":"rootlevel","prop-dash":"hello"}  
    

    When I tried to get "prop-dash" in my Set Variable using:

    @pipeline().parameters.input.prop-dash  
    

    I got an error similar to yours. So I tried another method:

    @pipeline().parameters.input['prop-dash']  
    

    This debugs successfully and returned the value "hello"

    Please try the below expression and let me know if it works.

    @activity('RetrieveRecordCount').output.ADFWebActivityResponseHeaders['Pagination-Page-Count']  
    

0 additional answers

Sort by: Most helpful