Back in February I wrote a blog post on how to schedule Twitter content with Microsoft Flow and SharePoint. This was quite well received, and I’ve had a few discussions with various people, who tried it themselves. One of those is fellow MVP Luise Freese (Twitter, Medium) (extremely passionate & sketchnote artist extraordinaire), who used my instructions and replicated the setup. And as I saw recently and also discussed with her, made some improvements to the Flow, which I was also thinking of doing.

My initial setup allowed posting content, but it did not provide any means to add any images to the Tweets. But seeing this tweet by Luise which she had scheduled and which includes an image made me realise, that I should get in touch with her (which I did straight away) and also test it myself (which I also did soonest).

So, I got some feedback from her (which matched the Flow I had constructed in my mind to achieve the above), made some smaller updates to my Flow, tested it, and succeeded. Here’s what needs to be done (check my first post for the initial Flow, which I’m updating here).

First, we initialise a new variable of type Object (I called it Media):

Next, we need to update the “Apply to each” item loop. First we add a “Get attachments” action at the top of it to retrieve the attachments (if any) for the current item.

As there may be multiple attachment, I’m doing another “Apply to each” loop for the attachments, retrieve the attachment content, and update my Media variable.
If there are multiple images attached, this means that only the last image will be used (The documentation mentions only “Media to be posted” of type binary, so only one item can be used here; I tested it with an array, which failed). Instead of doing this loop I could’ve also done a selection of the first item only, there’s obviously more than one way of achieving this).
If there is actually no attachment, this step will be skipped, but posting a tweet will still work (Media variable will be empty in this case, so no media will be posted).

Lastly, I simply updated the existing “Post a tweet” action to include the Media.

Here’s the final Flow in its full glory:

3 thoughts on “Scheduling Twitter Content with Microsoft Flow Part 2 – Images”

  1. Hi there I am so happy I found your webpage,
    I really found you by mistake, while I was browsing on Digg
    for something else, Regardless I am here now and would just like to
    say thanks a lot for a remarkable post and a all round exciting blog (I also love the theme/design), I don’t have time to
    browse it all at the minute but I have bookmarked
    it and also added your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the superb job.

  2. I do not know whether it’s just me or if perhaps everybody else encountering issues with your website.
    It appears like some of the written text in your posts are running off the screen. Can someone else please comment and let me know
    if this is happening to them too? This might be a issue
    with my browser because I’ve had this happen previously.
    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.