Get your no code stock price alert on LINE by Power Automate in an hour! (3–2)

雲端架構師|中途筆記
5 min readJul 30, 2020

If you’ve followed my previous post, there should be one question comes to you:

“Where do I save the name and the ideal price for tracking stock?”,

“How do I manage different tokens if my friends also want to use my solution?”

The answer is: you need a data source! the data source is a place where the Power Automate can read and write relevant information such as price point, stock number and token.

Now here comes another question: “What kind of data source I should choose?”

There are various options, such as Excel sheet, SharePoint list, or Data Base. In this post, I’ll use CDS (Common Data Service) as it’s fully integrated with Power Platform and is easy to build without knowing how to query a data base. When design appropriately, it’s super powerful!

In this post, we’ll covering the following

-Build an Entity on CDS

-Create a Form so that you can write data into the entity

-Read and Write the entity from Power Automate

Let’s get started!

  1. Build an Entity on CDS

Visit flow.microsoft.com

Visit Solution and click on the solution we’ve created in the previous post

Click New and add an Entity

Enter the following information and click Done

The UI will bring you to the following screen, now you should see there are many field built automatically. CDS is designed to fit different business scenarios so that users don’t need to build and relate on their own.

Click on Add field

Fill in the Field Properties and click Done

Repeat the previous steps until you have the following fields:

(If you are not a Chinese reader, no worries, the column in the middle shows the English)

Once created, click Save Entity and the bottom right

Congratulations! Now you have a place to put all the data.

2. Create a Form so that you can write data into the entity

Go to https://forms.office.com

Choose New Form

Create the questions based on your needs

Choose Share on the top right and you’ll see the following screen.

Don’t forget the click Anyone with the link can respond so that your respondent doesn’t limit to the one in the same organization. Also, there are different ways to share the form, such as link or QR code.

Now the form is ready, let’s go back to the solution.

As previous flow, go create a new Power Automate and select Trigger and Actions as following.

Tips: Use Dynamic Content to insert the values collected in the Form by click the blank field in the Response ID, the Dynamic Content will pop up as following, choose it so that you can further use all the values in the form in the next actions.

Let me expand my Create a new record action card for you so that you know better how to use the Dynamic Content

OK, now you can test it and see if it works!

Every submission should write into the entity we’ve just created!

3. Read and Write the entity from Power Automate

Now, we need to let the Power Automate consume the entity.

Let’s go back to the first Power Automate we’ve created in the previous post.

In the previous post, we’ve walked through how to Get and Post different APIs, but the CDS part was missing

Now it’s time to add it back, simply insert an action next to the Recurrence trigger and find CDS to choose List records.

Then, expand the following Apply to Each card and add the value. Also, choose Update a record so that the Power Automate will update the current price based on the schedule

Finally, let’s set an Condition so that your LINE will only notify you when needed.

In this scenario, the LINE will only notify me when the current stock price is less than or equal to the target price.

“Is there something else we are missing?” you may ask. Yes, we are still missing a place accessing the list of stock and checking the tokens using this service. As this will need some skills on Model Driven App. Let’s put it on the next article.

Now you see how to let the Power Automate work for you so you can spend valuable time on other things!

Thanks for reading!

--

--

雲端架構師|中途筆記

我幫助被逆境困住的人做熱愛的工作,自我實現、享受生活。有時候講話會口吃,考托福口說的時候曾經一個字都說不出來,現在在澳洲當雲端架構師,指導企業設計和規劃雲端解決方案。https://wanchunghuang.com/