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

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 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 blogPower Automate Video Tutorials
abm
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 blogPower Automate Video Tutorials

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (26,503)