cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

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
Highlighted
Super User III
Super User III

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
Highlighted
Super User III
Super User III

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
Highlighted

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (13,682)