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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (866)