cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sandeepgeorge
Microsoft
Microsoft

Kusto query output formatting into email

I am trying to hook up a flow which runs a kusto query and then sends an email to folks.

 

The kusto query has a 2 columns
1. manager alias

2. Data specific to manager

 

I managed to hook up the query + Compose step to extract 'Body' of the kusto query and compose and email with the 'Outputs'. The email I receive is a json output. for example
{"value":[{"L4Manager":"HENRYSA","Source":"Other","count_":1180},{"L4Manager":"ALBERT","Source":"Other","count_":14927}]

 

How do I parse this 'Output' so that 

1. I can send email to the L4Manager alias

2. Is there a way for me to compose the json into a table format similar to how we view results in Kusto explorer?

 

Thanks,

Sandeep

1 ACCEPTED SOLUTION

Accepted Solutions
ChristianAbata
Community Champion
Community Champion

hi @sandeepgeorge  here is what I do to create a table from your json response.

nofirst.PNGnolast.PNG

No value

replace(string(outputs('Json')),'"value":','')

No fisrt

substring(outputs('NoValue'),2,sub(length(outputs('NoValue')),2))

NoSecond

substring(outputs('NoFirst'),0,sub(length(outputs('NoFirst')),2))

Array

replace(outputs('NoLast'),'","','"},{"')

 

Hope this can help

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @sandeepgeorge 

 

Yes you can use the JSON Parse step to extract the values.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @sandeepgeorge 

 

Here it is

 

image.png

 

The schema is as follows:

 

{
"type": "array",
"items": {
"type": "object",
"properties": {
"L4Manager": {
"type": "string"
},
"Source": {
"type": "string"
},
"count_": {
"type": "integer"
}
},
"required": [
"L4Manager",
"Source",
"count_"
]
}
}
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
ChristianAbata
Community Champion
Community Champion

hi @sandeepgeorge  here is what I do to create a table from your json response.

nofirst.PNGnolast.PNG

No value

replace(string(outputs('Json')),'"value":','')

No fisrt

substring(outputs('NoValue'),2,sub(length(outputs('NoValue')),2))

NoSecond

substring(outputs('NoFirst'),0,sub(length(outputs('NoFirst')),2))

Array

replace(outputs('NoLast'),'","','"},{"')

 

Hope this can help

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,877)