HomeAbout Me
Microsoft 365
30 min to a social media scheduling solution
Simon Ågren
Simon Ågren
May 25, 2022
2 min

Table Of Contents

01
The idea
02
The solution
03
Scheduling this post
04
Summary
30 min to a social media scheduling solution

Have you ever wanted to schedule Twitter and LinkedIn posts without using a third-party solution? You are halfway there if you already have a Microsoft 365 developer tenant! Follow along as we quickly build a solution for this with low-code tooling in the Power Platform.

The idea

My blog is based on GatsbyJS, where I write the blog posts in markdown in Visual Studio Code. I keep the code in a repository on GitHub, and I’m using GitHub actions for CI/CD. I recently added the possibility of scheduling my blog posts based on the blog post’s date in the markdown front matter.

This got me thinking that I might want an easy solution to schedule a Tweet and a LinkedIn post for the time when the blog post is scheduled to be published.

The solution

I went with the simplest possible solution that I could come up with, using a SharePoint list and a Power Automate Flow, and I also added a PowerApps Canvas app to use on my phone.

SharePoint

I started by creating the list in SharePoint and just added some columns from the UI. Who has time for Content Types, right?

Figure 1: SharePoint list containing the scheduled blog poss
Figure 1: SharePoint list containing the scheduled blog poss

  • Title: a text column containing the title
  • Text: a multi-row text column containing the bulk text of the blog post
  • URL: a HyperLink column
  • Hashtags: a text column containing the hashtags
  • Media: a Choice column with the options Twitter, LinkedIn and All
  • Scheduled: a Date and Time column
  • Posted: a Yes and No column that defaults to No

Power Automate

I then created the Flow from the existing list.

Figure 2: Create Flow from SharePoint
Figure 2: Create Flow from SharePoint

After a new item is created in the SharePoint list and the Flow is triggered, we use the date and time value from the Scheduled column, and we Delay until that specific date and time. I will never schedule so far ahead in time that there are any chances of the Flow timing out.

Figure 3: Delaying until the scheduled date and time
Figure 3: Delaying until the scheduled date and time

After we have waited the necessary amount of time, we use the Get item action to get an up-to-date version of the item, just in case we changed the title, text, URL or hashtags.

The Switch case checks the Media value and routes us to a appropriate case. We then create the social media post(s) using the values from Title, Text, Hashtags and URL.

Finally, we update the list item to Posted as Yes.

Figure 4: Social media switch case in Flow
Figure 4: Social media switch case in Flow

IMPORTANT! Just understand that there is no error handling at all in this Flow. You should probably look into making it more robust.

Power Apps

I then scaffolded a Power App from the list; this gives you CRUD capabilities from the get-go. I made some minor Tweaks regarding colors and removed Posted and Attachments from the form. Finally, I saved the app and published it.

Figure 5: Create Power App from SharePoint
Figure 5: Create Power App from SharePoint

Scheduling this post

  1. I added the PowerApps app to my iPhone and pinned the Canvas app to the home screen.
  2. Then I created a new item from the Power App.
    Figure 6: Scheduling post from the iPhone
    Figure 6: Scheduling post from the iPhone

Figure 7: List of created posts in the Power App
Figure 7: List of created posts in the Power App

  1. The Flow got triggered.
    Figure 8: Running Flow
    Figure 8: Running Flow

What’s left for me is to check-in and push this blog post to my GitHub repository, and then the blog post scheduling sorts the rest.

Summary

By now, you should have gotten some ideas on how to create a simple scheduling solution for your social media posts. How would you have done it?
And when you read this, we have waited long enough, and the Flow has already run and created the social media posts. The timeline is very confusing here. Anyways…

Thanks for reading
/Simon


Tags

powerplatformsharepoint
Previous Article
Microsoft 365 Sharing Settings

Simon Ågren

CTA & Microsoft MVP

Solving business problems with tech

Expertise

Microsoft 365
Azure

Social Media

githubtwitterwebsite

Related Posts

Groupify a SharePoint site - the collection
Groupify a SharePoint site - the collection
September 10, 2022
2 min

Quick Links

About

Social Media