Did you know that you can earn money by buying your products at the right time? The variable pricing model that is used at Amazon is great, but it does mean that you have to check the price every day. Why would you? It is a lot quicker and easier to get Microsoft Flow to do this for you!

I’m going to start developing this flow by triggering the flow manually. The first challenge is to get the price of the product that you are interested in.

I think it is time to buy a Surface Pro, but of course I don’t want to may too much for this. Also I’m in no rush! I’m going to wit for a while. If in the meanwhile you find it anywhere cheaper please do let me know.

I found the Microsoft Surface that I want on Amazon.

https://www.amazon.co.uk/Microsoft-Surface-12-3-Inch-Laptop-Platinum/dp/B07CTJWGVJ/ref=sr_1_3?ie=UTF8&qid=1533030577&sr=8-3&keywords=Microsoft

No I’m going to make my flow read that page. by a single HTTP call to the page that I found on Amazon.co.uk. Wow, that was easy!

This gives me the page that I want. Now I’ll split the HTML returned by the Text “Price:” on the page.

 

This now gives me an array of two elements where the second element contains the price and some html that I’m not interested in.

Now with he following expression I’m getting the price of my surface pro:

replace(substring(last(variables('Array')),indexOf(last(variables('Array')),'£'),150),'</span>','')

My flow runs successfully:

 

Looking at the Get the price action I can see the current costs of the laptop that I’m interested in.

Now all I have to do is create a recurrence trigger to run my Flow and record the price every day in for example a SharePoint list. Compare today’s price with yesterday’s price and send myself an email when the price has come down.

 

 

Advertisements