Integrating MS Dynamics 365 to non-Microsoft Services – Guide on how to post to Twitter from MS PowerApps via MS Flow

January 12, 2017

By Emma Vassallo Bianchi

The Twitter connector for Microsoft PowerApps lets you get tweets, timeline, friends, and followers from your Twitter account, as well as post tweets to your Twitter account. Below we will show how to create a Twitter connection and use the connection in our app to post a message to twitter. Before we get started we need to install PowerApps and have a Twitter account.

Create and use a Twitter connector:

Before our logic app can access any service, we first need to create a connection to the service. A connection provides connectivity between a logic app and another service.

STEP 1
Open PowerApps for Windows and in the logic app designer click on connections, then click on the new connection button.

1

 

STEP 2
Enter Twitter in the search box and click on create.

22

 

STEP 3
Click create on the message shown below.

2

 

STEP 4
You will be prompted to provide your Twitter credentials which will be used to authorise your logic app to connect to, and access your Twitter account data. Confirm your authorisation.

3

 

STEP 5
Notice the connection has been created.

4

 

Create a Flow:

To perform one or more tasks when an event occurs in an app we can use Microsoft Flow. In this scenario we will configure a button so that when a user clicks it, a message is posted to Twitter.

STEP 1
To create a flow, click on Flows in the logic app designer, and then on Create from blank.

5

 

STEP 2
You will be presented by the screen shown below. Click on New step.

6

 

STEP 3
Click on add an action

7

 

STEP 4
In the search box input Twitter and select ‘Twitter – Post a tweet’

9

 

STEP 5
Next click in the text box named ‘Tweet text’ and select ‘Ask in PowerApps’ as dynamic content for the Tweet.

10

 

STEP 6
You can rename the flow by means of the text box at the top of the page as shown below.

11

 

STEP 7
When ready, click on Create flow and then on Done.

12

 

13

 

STEP 8
Your new flow has now been created.

14

 

Add flow to your App:

STEP 1
In PowerApps studio for Windows, select New in the File menu and select the Blank app tile. Select phone layout.

15

 

STEP 2
Add a text input control and a Button control

16

 

STEP 4
With the button control selected, select Flows on the Action tab

17

 

STEP 5
Select the flow we created in the previous section

18

 

STEP 6
In the formula bar type or paste “I would like to speak about: ” & Text(TextInputOne)) at the end of the formula that has been added automatically.

19

 

STEP 7
Open the preview by pressing F5 or by selecting the play button on the upper right corner of the screen.

20

 

STEP 8
Type text in the text box and then click the Tweet button.

21

 

A Tweet should be posted to the Twitter account which was authorised with PowerApps in the steps above.