'ParseJson not valid When message is received from topic auto complete in logic app

I am new in the logic app. I want develop one new logic app when message received from topic content data couldn't parse as json , its throwing error like **"

InvalidJSON. The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value cannot be parsed: 'Unexpected character encountered while parsing value: e. Path '', line 0, position 0.'

."** after decode my string my json like below

{"Id":"ddd9cc1e-8e41-4684-be2e-cd874398e209","Type":"userData","Content":[{"EmpId":1,"EmpName":"Raja1"},{"EmpId":2,"EmpName":"Raja2"}]}

Any one suggest whats wrong am doing here? Attached some screenshot for reference.

enter image description here enter image description here



Solution 1:[1]

As you are trying to convert an xml to json. You are very close - only issue is @json() expects either

  1. A string that is a valid JSON object.
  2. An application/xml object to convert to JSON.

The @base64toString() is converting to a string, but you really need to let @json() know this is #2 and not #1, so changing expression to this should work:

@{json(xml(base64toBinary(triggerBody()[contentdata])))[foo]}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RajkumarMamidiChettu-MT