Azure Logic Apps–Parsing JSON message from service bus

What I want: When the logic app trigger receives a JSON formatted message from Azure Service Bus topic, I want to send a notification to the “email” field.  My sample message structure looks like this:

image

What happens: Because a message received on service bus doesn’t have a predefined format – it could be JSON, XML, or anything else – so Logic Apps doesn’t know the structure of the message.  So in the designer, it looks like:

image

Which is great, but it just dumps out the entire object, and not the email field that I need.

How to fix it: Fortunately the fix is pretty easy, basically you need

1) Select the Content output (above), you are going to edit this value.

2) Switch over to ‘Code view’ and manually type the expression (below).

If you haven’t used it before, code view can be found in the toolbar:

image

Once you are in the code view, scroll down to the connector you are interested in. You will see the expression for the trigger body. This is the entire message received from the trigger, basically.

image

You need to modify this to parse the entire message using the ‘json’ function, then you can access it’s typed fields.

If you have ever used JSON.parse (or any object deserialization in pretty much any language for that matter) this concept should be familiar to you.  When I was done I ended up with:

image

I’ve broken the entire segment into two parts, a) parses the content and b) accesses the ‘email’ field of the parsed JSON object.

Hope this helps someone!

 

Update: if you are seeing an error when trying to parse see my new blog post Azure Logic Apps-The template language function ‘json’ parameter is not valid.

19 Replies to “Azure Logic Apps–Parsing JSON message from service bus”

  1. Packers and Movers Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/ Packers and Movers Delhi – http://getpackers.com/packers-and-movers-delhi/ Movers and Packers Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/ Movers and Packers Delhi – http://getpackers.com/packers-and-movers-delhi/ Packers and Movers in Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/ Packers and Movers in Delhi – http://getpackers.com/packers-and-movers-delhi/ Movers and Packers in Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/ Movers and Packers in Delhi – http://getpackers.com/packers-and-movers-delhi/

  2. ????? ?????? ???? ???? ??? ??? ??????? ???? ??? ??? ?????? ???? ??? ??? ??????? ???? ??? ??? ??????? ????? ??? ??????? ????? ??? ?????? http://goo.gl/iAJsRz ???? ??? ???? ??????? http://www.east-eldmam.com ??? ??? ??????? http://goo.gl/qga5YC ???? ??? ??? ?????? http://goo.gl/Vv4Sp9 ???? ??? ????? ?????? http://goo.gl/52zZFy ??? ????? ??????? http://goo.gl/VgTwlW ???? ??? ??? ??????? http://goo.gl/SHZHnV http://goo.gl/1kXTpJ ????? ??? ????? ??????? ?????? http://goo.gl/DuLCNP http://goo.gl/iksDnr http://goo.gl/Etnu4A http://goo.gl/x3BKPU http://goo.gl/hAu2Pm http://goo.gl/7VW8I5 http://goo.gl/3NkrF1 http://goo.gl/4XVcnD http://goo.gl/QkRQkZ ???? ????? ??? ??????? http://goo.gl/BZTlLb ???? ????? ???? ??????? http://www.east-eldmam.com/2015/10/06/sofas-cleaning-company-in-dammam/ ???? ????? ??? ??????? http://www.east-eldmam.com/2016/04/27/cleaning-carpeting-and-carpet-company-in-dammam/ ????? ????? ??????? http://goo.gl/Nw25w7 ???? ????? ??????? http://goo.gl/Q7uwoI ???? ????? ???? ???????

  3. ???? ????? ??? ???????? ??????? ??? ????? ????? ???? ?? ???? ???? ???? ????????? ?????? ??????? ????? ?? ????????? ???? ?????? ??? ??? ????????? ???? ?????? ????? ??????? ???????? ??????? ???? ???? ?????? ???? ????? ????? ????? ????? ?????? ????? ???? ????? ????? ???? ?????? ???????? ????? ????? ??????? ??????? ????? ??? ??????? ???????? [URL="https://elayad054950.com/cleaning-majales/"%5D???? ????? ????? ???????? ???????[/URL] ???? [URL="https://elayad054950.com"]?????? ???? ?????? ?????? ???????[/URL] <a href="https://elayad054950.com&quot;> ???? ?????? ???? ?????? ?????? ???????</a> <a href="https://elayad054950.com/cleaning-majales/&quot;> ???? ????? ????? ???????? ??????? 0549503911</a>

  4. ???? ??????? ?????? ???? ?????? ????? ????? ????? ????????? ???? ????? ??? ????????? ???? ?????? ????? ??????? ?????? ???????? ????? ??? ????? ?? ??????? ?????? ????? ?? ???????? ??? ????? ??? ????? ??? ??????? ???? ???? ????? ?? ???? ??? ????? ???? ?????? ??? ???? ?????? ????? ????? ??? ??????? ???? ?????? ???? ???? ??????? ???????? ???? ??????? ??????? ???????? ??? ????? ???? ??? ????? ??? ?????? ??????? ?? ??? ??????? ???????? ???? ????? ?? ???????? ?????? ?? ??????? ??? ?????? ????? ???? ?????? ??????? ???? ??????? ???? ???????? ????? ????? ????? ?????? ????? ?? ??????? ??????? ????? ???? ??????? ???? ??????? ?????? ?? ????? ??????? ????? ???? ??? ????? ???? ???? ?????? ???? ??????? ??????? ???????? ????? ???? ?????? ????? ??? ????? ?? ??? ??????? ????? ???? ??? ??? ???????? ??????? ???? ??? ??? ????? ???? ??? ??? ???? ???? ??? ??? ??????? ???? ??? ??? ??????? ???? ??? ??? ????? ??? ???? ???? ?????? ????? ??????? ???? ??????? ????? ???? ????? ???????? ??????? ???? ????? ???? ???? ????? ??? ??????? ???? ????? ??? ????? ??? ???? ???? ?????? ????? ????? ???????? ????? ???? ????? ?????? ???????? ??????? ???? ????? ?????? ???? ???? ????? ?????? ??????? ???? ????? ?????? ??????? ???? ????? ?????? ????? ??? ???? ???? ?????? ????? ?????? ??????? ????? ??? ??????? ???? ?????? ????? ???????? ??????? ???? ?????? ????? ??????? <a href="https://aayad.com/transfer-and-relocation-company-in-jeddah/&quot;> ???? ??? ??? ????</a> <a href="https://aayad.com/3fsh-mnqwl-6201/&quot;> ???? ??? ??? ???????? ???????</a> <a href="https://aayad.com/afdal-naql-afsh-eldamam/&quot;> ???? ??? ??? ???????</a> <a href="https://aayad.com/naqllafshyanbou/&quot;> ???? ??? ??? ?????</a> <a href="https://aayad.com/????-??????-????????-???????/"> ???? ?????? ???????? ???????</a>

  5. 92146 192244I?m not that much of a internet reader to be honest but your sites really nice, keep it up! I?ll go ahead and bookmark your website to come back later. All the best 963940

  6. ???? ?????? ??????? ???????? ????? ??? ??????? ??? ??? ??? ??? ???? ??? ??????? <a href="https://aayad.com/afdal-naql-afsh-eldamam/&quot;> ???? ???? ??? ??? ???????</a> <a href="https://aayad.com/transfer-and-relocation-company-in-jeddah/&quot;> ???? ??? ??? ????</a> <a href="https://aayad.com/naqllafshyanbou/&quot;> ???? ??? ???? ?????</a> <a href="https://aayad.com/3fsh-mnqwl-6201/&quot;> ??? ??? ???????? ???????</a> <a href="https://aayad.com/aayad-tbook-650/&quot;> ???? ??? ??? ?????</a> <a href="https://aayad.com/%D8%B4%D8%B1%D9%83%D8%A9-%D9%86%D9%82%D9%84-%D8%B9%D9%81%D8%B4-%D8%A8%D8%A7%D9%84%D8%B7%D8%A7%D8%A6%D9%81/&quot;> ???? ??? ??? ???????</a> <a href="https://aayad.com/&quot;> ???? ?????? ?????? ??? ?????</a> <a href="https://www.facebook.com/search/top/?q=%D8%B4%D8%B1%D9%83%D8%A9%20%D8%AA%D9%86%D8%B8%D9%8A%D9%81%20%D8%AE%D8%B2%D8%A7%D9%86%D8%A7%D8%AA%20%D8%A8%D8%AC%D8%AF%D9%87%200534544488%20%D8%A7%D9%84%D8%B9%D9%8A%D8%A7%D8%AF&quot;> ???? ????? ?????? ????</a> <a href="https://www.facebook.com/pg/tanzeeftaief/reviews/&quot;> ???? ????? ??? ???????</a> <a href="https://www.facebook.com/elayadnew/&quot;> ???? ??? ??? ???????</a> ???? ????? ??? ?????

  7. ??? ???? <a href="https://unionaire19058.wordpress.com/??????-?????-???/">?????? ????? ???</a> ???? ???? ?????? ?????? ???? ????? ?? ??? ????????? ?? ???? ?? ?? ????? ?? ???? ????? ?????? ????? ??????? ?????? ??? ????? ????? ????? ???? ?????? <a href="https://unionaire19058.wordpress.com/??????-?????-???/">????? ?????? ??? </a> ????? ???? ???? ????? ?????? ???? ???? ??? 19058 <a href="https://unionaire19058.wordpress.com/%D9%85%D8%A8%D9%8A%D8%B9%D8%A7%D8%AA-%D9%8Ahttps://unionaire19058.wordpress.com/%d8%aa%d9%83%d9%8a%d9%8a%d9%81%d8%a7%d8%aa-%d8%a8%d8%a7%d8%b1%d8%af/&quot;>????? ?????? ???</a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">????? ?????? ??? </a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">?????? ????? ???</a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">????? ????? ?????? ??? </a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">??????? ?????? ??? </a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">????? ?????? ??? 19058 </a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">????? ??????? ?????? ??? </a> <a href="https://unionaire19058.wordpress.com/??????-?????-???/">?????? ??? </a> https://unionaire19058.wordpress.com

  8. I am facing the issues while reading json data from service bus topic “@base64ToString(triggerBody()?[‘ContentData’])” the content will returning below format how can I read field values like EmpID “{\r\n \”EmpID”\”: \”1213\”, r\n \”Name”\”: \”Name\”, r\n \”Salary”\”: \”1233\”\r\n}” "EmpID": is parameter of stored procedure from above EmpID value can you help how to read EmpID value of 1213 tanks, Nagesh

  9. Was very good post ,????? ????? ?? ???? http://www.matlabi.ir/order-matlab-project/ ????? http://www.matlabi.ir/ , http://www.matlabcoder.com , ,????? ???? http://matlabi.blogfa.com/ , ,????? ????http://www.matlabi.ir/shop/ , ???? ???? ?? ???? ????? ????? ???????? , ???? ???? ?? Matlab , ????? ???? , ????? Matlab , ???? , ????? ????? ???? , ????? ????? ???? <a href="http://www.matlabi.ir/order-matlab-project/&quot;>???? ???? ?? ????</a> <a href="http://matlabi.blogfa.com/&quot;>????? ????</a> <a href="http://www.matlabi.ir/order-matlab-project/&quot;>????? ????? ????</a> <a href="http://www.matlabcoder.com&quot;>????? ????</a> <a href="http://www.matlabi.ir/order-matlab-project/&quot;> ????? ????? ????</a> <a href="http://www.matlabi.ir/order-matlab-project/&quot;>???? ???? ?? Matlab</a> <a href="http://www.matlabi.ir/shop/&quot;>????? ????</a> <a href="http://www.matlabi.ir/&quot;>????? Matlab</a> <h1><a href="http://www.matlabi.ir&quot;>????? ????</a></h1> <a href="http://www.matlabi.ir/order-matlab-project/&quot;>???? ???? Matlab</a> <a href="http://www.matlabi.ir/shop&quot;>project Matlab</a> [url=http:// matlabi.blogfa.com]matlab project[/url] [url=http://www.matlabi.ir]????? ????[/url] [url=http://www.matlabi.ir]????? ????[/url] [url=http://www.matlabcoder.com]????? ????[/url] [url=http:// matlabi.blogfa.com]????? ????? ????[/url] http://www.matlabcoder.ir

Leave a Reply

Your email address will not be published. Required fields are marked *