itms
itms

Reputation: 203

Logic Apps - Data Operations Parse JSON not parsing Content from Event Hub

I am trying to create a logic app that connects to event hub and sends an email whenever an event is added to the event hub.

I was able to get it working when connecting EH to outlook connectors. I want to be able to parse the data and extract certain fields from the event content. I look up online to use Parse JSON from the Data Operations action but it seems not to be able to parse the content enter image description here

I tried using Body as the input and it succeeds but the event fields are empty, indicating me that it not getting the event data.

Any ideas?

Upvotes: 0

Views: 1484

Answers (1)

George Chen
George Chen

Reputation: 14324

I have a test and reproduce your problem, suppose your content-type is application/octet-stream, if yes the content will be encoded with base64, then the Parse_JSON input content should be decodeBase64(triggerBody()?['ContentData']).

enter image description here

enter image description here

Also you could change the content type to application/json or text/plain, it will just work.

enter image description here

Upvotes: 2

Related Questions