Power Platform IndiePubs: Sending badges from Badgr to a Slack channel
February 11, 2021
I recently learned about Badgr from one of the speakers at our recent internal Power Platform session. This is a service for issuing and managing digital badges. I started looking at it from a use case: what badges would I want to create for my own professional development and what would make sense for low code enthusiasts.
And then I thought if I could create a Power Automate flow that sent messages to a Slack channel, perhaps I could automate the sharing of any newly created badges in Badgr to Slack.
I created a Badgr custom connector from their Swagger files and after fixing the errors from the import, I created a new scheduled flow. Since the Badgr connector only has actions, I needed to determine a time interval to get all of the latest badges. I decided on a weekly Recurrence trigger.
Then I added a new Get All Assertions action from the Badgr connector and used the following dynamic expression to get all badges issued in the last 7 days:

This used the badge result and output a list I could use. Using an HTML table, I created a table that formatted the important fields from the Badgr data.

Finally, the HTTP action to send that data to Slack.

I’m using the entire body of the table, but you can also use a compose action to add additional text above or below the table. I’m then using the body of the HTTP action in a Condition.

If the status code is 200, it was successful. Otherwise, I’m sending myself a notification.