question

LawrenceBorbn-1658 avatar image
0 Votes"
LawrenceBorbn-1658 asked ·

Error on dynamic content at Set Variable Activity

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
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MartinJaffer-MSFT avatar image
0 Votes"
MartinJaffer-MSFT answered ·

Hello @LawrenceBorbn-1658 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']
· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks so much, it work like a charm, take care.

0 Votes 0 ·