Hi,
New in the community 🙂
I am trying to set up a feature that send email from power bi application.
i am displaying in a screen the collection amount per month and year and in another graph, i am displaying the repartition by clients
In power automate, i would like to send an email that contains :
- User
- Year
- Month
- Client
- Collection Amount
Currently i am receiving the right email, but i am receiving 11 times (11 clients for the test user)
How can i correct it ?
Thank you,
Avy
Take another look at the BLOG post. To get just one email per account you need to run the loop on the individual emails, not on the Power BI data. then filter the data using the email for the current loop and use that to create and send the HTML table to that one email account. It doesn't look like you included the stuff to get the unique list of email accounts like I did in the BLOG.
Hi @Pstork1 ,
I tried to include all the step inside the Apply to each , that means after the array function, and i still got 2 emails with the two partner inside.
Then there is a problem with your Filter Array action or you aren't generating the HTML table out of the results of the filter array action. that's why my sample uses the Parse JSON. Because after filtering you don't have access to the individual columns in the result. So I suspect you are filtering but not using the results of the filtering to create the HTML table for the email.
I cannot use the output of the array as your post, because it will send real emails. so i am using my User email.
But i will simplify the problem, lets remove the client field :
I Have a graph that shows amount per partners and lets suppose that i select 2 partners that seems to have weird amounts :
Year | Month | Partner | Amount | |
2023 | 1 | A | A@email.com | 10 |
2023 | 1 | B | B@email.com | 10 |
With my flow, its sending 2 email, 1 to Partner A and one to Partner B with these html table :
Year | Month | Partner | Amount | |
2023 | 1 | A | A@email.com | 10 |
2023 | 1 | B | B@email.com | 10 |
I want just to filter the data for each partner concerned , that means
For Partner A, should receive :
Year | Month | Partner | Amount | |
2023 | 1 | A | A@email.com | 10 |
and partner B should receive :
Year | Month | Partner | Amount | |
2023 | 1 | B | B@email.com | 10 |
Hope that would be easier for me to solve it
Thank you
Did you use the output of the Filter Array statement in the first run to generate from sample the schema? There should be a lot more to the schema then what you are showing. What does the output of your filter array look like? And what does the array you are running the loop on look like?
Following the same steps as the blog, it doesn't work.
in the email it still displays 2 partners. attached the screenshot
The schemas are dependent on your data so there is no way for me to design them for you. Run the flow once and take the output of the filter array and paste it into the button that generates the schema for you. This short video shows how to do it.
Power Automate - Parse JSON - How to get the Schema (Easy Method) - YouTube
Hi @Pstork1 ,
Thank you. Can you send me schemes to help me, i am not knowing power automate and cannot understand well if i dont have scheme to order the steps.
I tried this but still doesnt work.
If you can copy my screenshots and write on it, it would be easier.
Sorry to ask this thanks
In your case you might not need the Parse JSON. Instead you will run the Data Select twice. Once to get just the partner that you want to email the way you are doing it now. And the second time the way you did it in your original to get the information you want to include in the rows you send in the email. The first Data Select is just to get a list of unique Partner emails. Then inside the loop you filter the second Data Select by partner to get the rows for that partner and send out the email on that data. Then loop to get the next partner.
You only run the Parse JSON if the HTML table puts everything into one column after the filter array. If it does you add the parse JSON to get access to the individual columns after you filter. The first time you run it use {} as the schema. Then you can take the output from that run to generate the actual schema.
Hi @Pstork1,
Thanks for the blog post. I am trying to apply the step but in the step of Parse JSON, i cannot run it because it didn't gave to save and apply (I am from power BI).
what do i need to go one ?
I attach the flow with the expression inside, hope it will be helpfull
Thank you for your precisous time