Error on dynamic content at Set Variable Activity

Lawrence Borbón 21 Reputation points

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:

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.
7,140 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 25,711 Reputation points

    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:


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


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


    This debugs successfully and returned the value "hello"

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


0 additional answers

Sort by: Most helpful