0

I have a Adf flow , in which, i have stored the data in a array Variable(namely 'VariOutput'), that thing is present in a If Condition Activity.

and in IF condition False Activity , i have given the Web activity link. the code used is

'''{ "RunId":"Dummy", "applicationName": "@{pipeline().parameters.AppName}", "ErrorCode":"error", "ErrorMessage":@{concat('File/Files not found-', string(variables('VariOutput')))}, }'''

But the webactivity is not processing the Array Variable VariOutput and throwing an error.

enter image description here

error :: error": { "code": "InvalidRequestContent", "message": "The request content is not valid and could not be deserialized: 'Unexpected character encountered while parsing value: F. Path 'ErrorMessage

ignore the line number 7 in the error , as i have deleted part of the error. enter image description here

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Avenue Guy
  • 27
  • 5

1 Answers1

0

The request content is not valid and could not be deserialized: 'Unexpected character encountered while parsing value: F. Path 'ErrorMessage

  • I tried to repro this and got the same error.

enter image description here

  • This is because of double quotes in the variable. Replace the double quotes with single quotes and pass it in the web activity.
  • Give the below expression for error message "ErrorMessage":"@{concat('File/Files not found-', replace(string(variables('VariOutput')),'"',''''))}"

enter image description here

  • When the pipeline is debugged, it is executed successfully, and mail is sent.

enter image description here

Aswin
  • 4,090
  • 2
  • 4
  • 16
  • Hi Aswin , can you try Array variable , cause i seee the issue with Array variable only keep ["1","2","3","4"] as the VariOutput. then i get this error – Avenue Guy Jan 03 '23 at 14:59
  • Even for this input, It works fine. – Aswin Jan 03 '23 at 15:19
  • If you get error, share the input of web activity. Refer this [step:1](https://i.imgur.com/2Eq5E8R.png) and [step:2](https://i.imgur.com/QfhXnaA.png) – Aswin Jan 03 '23 at 15:22
  • Are you getting the same error? – Aswin Jan 03 '23 at 15:50
  • thanks aswin, the issue gets resolved when i use this as suggested by you. "Attachment":"@{pipeline().parameters.Attachment}", "mailBody":"

    Hi All,

    Error message: @{variables('ErrorVariable')}

    Error message2:@{concat('File not Found',replace(string(variables('HelloVariable')),'"',''))}

    – Avenue Guy Jan 04 '23 at 01:09