Adoption with fun and astronomy

A while back I detailed how to schedule a Dilbert comic to appear daily in a Microsoft Teams channel:

Adoption with fun

Sadly, Dilbert has moved behind a paywall which means that process no longer works. As such, I have been searching for a suitable replacement and have settled on the Astronomy Picture of the Day from NASA.

The basic concept from the Dilbert process is the same. This process also requires a premium Power Automate connector, which you can easily configure using with either a Power Platform Premium license or using Power Platform PAYG configuration with Azure which I have shown previously.

image

The starting process is to create a new Scheduled Cloud Flow and select the time when you wish that Flow to execute.

image

You will then need to add a HTTP action as shown above. This is a premium connection mentioned previously. This HTTP action will need to use a GET method for the URI:

https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY

image

Open that URI in a new browser tab and you should see some JSON information returned as shown above. Copy all of this.

image

Next add the Parse JSON action to the Flow. Then select the Generate from sample button at the bottom of this action as shown above.

image

Paste the text obtained from browser window previously in here and select Done.

image

Ensure you have the Body option selected in the Content area as shown above.

image

Next, add the Post message in a chat or channel as shown above. Add the appropriate Team and Channel. Then in the Message area select the </> icon in the top right to enable HTML editing.

image

Complete the formatting any way you wish but this is what I used:

<br><h1>Space Image of the day</h1>
<p><b>@{body(‘Parse_JSON’)?[‘title’]}</b><br><br>
<img src = “@{body(‘Parse_JSON’)?[‘hdurl’]}”><br><br>
@{body(‘Parse_JSON’)?[‘explanation’]}</p>

Basically, I’m going to display a heading, then the title, high definition image and explanation (from the returned result).

The result when the Flow runs is:

image

and when the imaged is clicked on, you see something like:

image

Remember, the whole idea here is to encourage people to regularly visit the Team in questions and hopefully drive more engagement of the environment.

2 thoughts on “Adoption with fun and astronomy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s