Microsoft Power Automate (Flow): movie ticket sale alerts

Due to Power Automate (Flow) licensing changes announced in 2019 and taking full effect in 2020, the HTTP connector referenced in this post is now considered "Premium" and requires a paid (Power Automate per user plan or Power Automate per flow plan) license.

While attempting to obtain awesome opening day seats for Star Wars Solo, I discovered another way to use Microsoft Power Automate (Flow) that I wanted to share. In brief, MS Power Automate (Flow) can be used to poll a web site and look for certain content in the response (Body). If you are one to repeatedly check a website throughout the day in anticipation of something happening (tickets going on sale, results posted, etc.), this flow may benefit you as well.

Being notified when tickets for a certain movie go on sale is not a new concept - Fandango and other ticket sellers allow you to sign up to receive email alerts (similarly to what this flow accomplishes). In my experience, there is often a delay (sometimes days) in receiving the “built in” email notifications; hence, I decided to put Power Automate (Flow) to work.

Overview

Read on for more detailed information about the trigger and actions

  • Use the “Recurrence” trigger to specify how often you want Power Automate (Flow) to check for movies tickets
  • Use the “HTTP” action to poll a URL where tickets will be available when they go on sale (example: IMAX)
  • Use a condition to look for the presence (or lack of) certain text on the website (in the Body of the HTTP response)
  • Use the “Send an Email” action to send a notification to your email or phone (SMS/text using your carrier’s email to SMS gateway address)

The completed flow

Overview of entire flow

Recurrence

The Recurrence trigger is almost synonymous to Cron on Linux. It allows you to kick off a flow at specific intervals. In my case, checking once per hour was sufficient; depending on your requirement, you can adjust the interval. Note, if you are on the free Power Automate (Flow) plan, you are limited to one run per 15 minutes.

MS Power Automate (Flow) Trigger: Recurrence

HTTP

I suspect this action is designed to allow Power Automate (Flow) to consume web services. As it happens, it can also be used for something much easier: accessing a URL and obtaining the HTML of the resulting page (like wget or curl). The hardest part of this step is finding a website that sells movie tickets that returns content properly when accessed in this manner. The action provides many options for customization (HTTP method, headers, etc.) but despite this, I was unable to get a valid response from Fandango (suspect Javascript/AJAX dependencies that render the final list of showtimes).

Instead of spending time trying to fix that, I simply located another site with a “landing page” for Star Wars Solo (that would ultimately contain a list of showtimes when tickets officially went on sale). IMAX to the rescue! From what I determined, IMAX often creates “place holder” pages for popular movies before tickets go on sale - they reside under /movies/name-of-movie.

It is also worth noting that if IMAX cannot determine the location of the client making the HTTP request, it defaults to Los Angeles, California and returns results for that region. In this case, that was fine - movie tickets generally go on sale to the public in all US locations simultaneously.

MS Power Automate (Flow) Action: Get event (V2)

Condition

IMAX made creating this condition very easy (thanks IMAX). To get a sense of the HTML that is returned from the HTTP action above, I recommend polling (and viewing in the browser) a few examples of IMAX showtime listings (the HTML Body anyway). At minimum, 1 for a movie where tickets ARE on sale and 1 for a movie where tickets ARE NOT on sale.

After a cursory review, it seemed most logical for me to check that the Body (returned from the HTTP action) did not contain the text “No upcoming showtimes”. If IMAX does not yet have movie times, that text is rendered as part of the Body (response); that specific text is never returned if show times are available.

MS Power Automate (Flow) Action: Get event (V2)

Send an Email

This is a run of the mill action that sends notifications to your email addresses and/or mobile phone via SMS if the condition above is true. In my case, simply knowing tickets were on sale was good enough - I did not aim to automate the purchase of tickets.

You could also use a “Notifications” action (push, etc.) here.

Final comments

This ended up working very smoothly - more so than I would have guessed with such minimal testing and effort up front. Like clockwork, Microsoft Power Automate (Flow) emailed me at around 10:00 PM Mountain time on May the 4th and I was the second person to secure tickets at one of Albuquerque’s leading theaters for the earliest showing of Solo on May 24.

Note, there was a lot of speculation that Solo tickets would go on sale on May 4th, so this was not a huge surprise. I plan to reuse this approach in the future when the date tickets go on sale is less predictable.

Lastly, remember to turn off the flow once tickets go on sale - otherwise, you will be notified every hour until the end of time. Alternatively, build logic into your flow so it only notifies you once!