Execute XPath getting error: Unable to cast object of type ‘Newtonsoft.Json.Linq.JValue’ to type ‘System.String’

Hi there,

I’m trying to execute XPath after deserializing the XML to get the attribute that I need, and this error pops up.

I even checked my XPath command on https://www.freeformatter.com … and its fine, check it out:

My Flowchart is like this:

I don’t know what’s happening, I’ve researched on this forum and I saw some people with the same error, but not on this activity “XPath”.

Someone can give me a clue about what it could be?

Hi @tiago

Could you try to escape some characters? Maybe the forward slashes are the cause of the issue here.

It’s a total guess though, I hope somebody who worked with the activity will chime in.