I recently discovered QuickChart and it is a fabulous tool for generating charts. It’s really easy to use from both PowerApps and Power Automate. In this post I am going to explain how to use it to generate charts with Power Automate using data from a SharePoint list.
Here is a sample of the SharePoint List:
Here are two samples of the Output Charts that are produced:
The charts are embedded into an email that produces a summary of the items in the list for that week. So let’s get on with it.
The HTTP action is used to make an API request to QuickChart, so a premium license is required.
The first chart above was created with a compose action and this HTTP Request:
So the complete JSON body looks like this when submitted:
{ "backgroundColor": "white", "width": 500, "height": 250, "format": "png", "chart": { "type": "doughnut", "data": { "datasets": [ { "data": [ 4, 3, 2 ] } ], "labels": [ "John Lilleystone", "Paul Murana", "Mohammed Islam" ] }, "options": { "title": { "display": true, "text": "Issues by Assignee" } } } }
The easiest way for you to generate the required JSON is to use the chart maker on QuickChart.io.
The most difficult part in this flow is reshaping the data from the SharePoint list, this is obviously highly dependent on what data you are trying to bring out into the chart so it’s difficult for me to explain, but this video should give you a good idea of how you can achieve it.
The other part you may get stuck on is embedding the image as Base64 into the email. I’ve got a separate post on how to embed an image in an email here.
I produced a weekly sales summary for a customer, which goes out to them every Friday:
I would be interested in hearing how you get on generating charts with Power Automate. Let me know if you come up with some cool use cases.
David says
Hi,
Thanks for posting this! I think I’m having issues with the URI that it wants – I get an emailed PNG with my labels & the data, but without the chart. I’m not sure what step I am missing, so any help would be appreciated. Thanks!