Azure Serverless Computing Cookbook
上QQ阅读APP看书,第一时间看更新

Designing the Logic App with Twitter and Gmail connectors

Perform the following steps:

  1. Now that the Logic App has been created, navigate to the Logic app designer and choose Blank logic app.
  2. Next, you will be prompted to choose Connectors. In the Connectors list, click on Twitter. Then, you will be prompted to connect to Twitter by providing your Twitter account credentials. If you have already connected, it will directly show you the list of Triggers associated with the Twitter connector, as shown in the following screenshot:

  1. Once you have clicked on the Twitter trigger, you will be prompted to provide Search text (for example, hashtags and keywords) and the Frequency at which you would like the Logic App to poll the tweets. This is what it looks like after you provide these details:

  1. Let's add a new condition by clicking on Next Step, searching for condition, and selecting Condition action, as shown in the following screenshot:

  1. From the previous instruction, the following screen will be displayed, where you can choose the values for the condition and choose what you would like to add when the condition evaluates to true or false:

  1. When you click on the Choose a value input field, you will get all the parameters on which you could add a condition; in this case, we need to choose Followers count, as shown in the following screenshot:

  1. Once you have chosen the Followers Count parameter, create a condition (Followers count is greater than or equal to 200), as shown in the following screenshot:

  1. In the If true section of the preceding Condition, search for Gmail connection and select Gmail | Send email, as shown in the following screenshot:

  1. It will ask you to log in if you haven't already. Provide your credentials and authorize Azure Logic Apps to access your Gmail account.
  1. Once you have authorized, you can frame your email with Add dynamic content with the Twitter parameters, as shown in the following screenshot. If you don't see Followers count, click on the Show more link:

  1. Once you are done, click on the Save button.