PowerApps Twitter Connector

In this Power Apps Tutorial, We will discuss what is a PowerApps Twitter Connector, How to create the Twitter connection in PowerApps, and how we can use it in the app.

Also, by taking some of the simple scenarios, We will cover these below topics:

  • What are the different types of functions in PowerApps Twitter
  • Get the User Timeline post in PowerApps Twitter
  • PowerApps Twitter get the Followers
  • PowerApps get details that are following by the user
  • PowerApps get information about a user
    • PowerApps Twitter get User ID
    • PowerApps Twitter get total Friends
    • PowerApps Twitter get User Full Name
    • PowerApps Twitter get User Profile Image URL
    • PowerApps Twitter get User Location
  • PowerApps Twitter Examples

PowerApps Twitter Connector

  • As we know, Twitter is a social networking site that helps to connect people and allow people to share their ideas and thoughts publicly. Normally, we are logging in with our user name and connecting this social media site through any of the browser.
  • Similarly, If you will connect the Twitter connection in the PowerApps, then you can do the same thing that you are doing using any browser.
  • You can get and post tweets, timeline, friends, and followers from your Twitter account. Also, you can retrieve all the twitter details of a specific user in the app. When you are doing the same thing in PowerApps, it is known as PowerApps Twitter or PowerApps Twitter Connector.
  • To view the Twitter results in PowerApps, you can use some PowerApps input controls like Label control, Gallery control, Data Table controls etc.

Also, check out, PowerApps Weather

Connect to Twitter in PowerApps

To connect the Twitter connection in PowerApps, follow the below instructions:

  1. Sign-in the PowerApps -> Go to Apps -> Select + New app -> click on Canvas as shown below.
Connect Twitter in PowerApps

2. Enter the new App name and choose any of the format (Tablet or Phone) that you want. hen click on the Create button.

Connect to Twitter in Power Apps

3. Next in the PowerApps screen, click on the Data (from the left nav) -> + Add data -> Search Twitter in the search text box. If you are already signed in, then it will not ask you to signin the Twitter otherwise you need to enter your Twitter sign in credentials.

how to connect Twitter in PowerApps

4. Then, select the Twitter Authentication Type as “Use default shared application” and tap on the Connect button. Now the twitter connection has added in the app as like the below screenshot.

connect to Twitter in PowerApps
connect to Twitter in PowerApps

PowerApps Twitter functions

Below table represents all the functions that are available in the PowerApps Twitter connection. Such as:

Function NameFunction Description
UserTimelineIt helps to retrieve a collection of the most recent tweets posted by the specified user
HomeTimelineIt retrieves the most recent tweets and re-tweets posted me and my followers
SearchTweetIt helps to retrieve a collection of relevant tweets matching a specified query
FollowersIt helps to retrieve users following the specified user
MyFollowersIt helps to retrieve users who are following me
FollowingIt helps to retrieve users who the specified user is following
MyFollowingIt helps to retrieve users that I am following
UserIt helsp to retrieve the details about the specified user (example: user name, description, followers count, etc.)
TweetYou can easily tweet any post by using this function
OnNewTweetIt helps to trigger a workflow when a new tweet is posted which matches your search query

PowerApps Twitter get User Timeline post

Suppose in PowerApps, you want to retrieve the user twitter timeline post using the user name. To achieve this, you can refer to the below things.

Items = Twitter.UserTimeline(
    "@SahuS93336854",
    {maxResults: 5}
).TweetText

Where,

“@SahuS93336854” = you need to provide your Twitter User Name

  • After this, you need to add the fields from the Edit field section of the data table control.
PowerApps Twitter Connector
  • Once you will save and preview the app, you can see upto maximum 5 number of twitter timeline post in the data table. As there is no post in my twitter account, thats why the data table is showing as blank.

PowerApps Twitter get the Followers

Here we will see how to get all the followers of a specifc user in PowerApps Twitter.

  • To workaround with this, add a Gallery control and set the below code on its Items property as:
Items = Twitter.MyFollowing({maxResults:7})
Power Apps Twitter Connector
  • When you will save and preview the app, you can see all the twitter follower details (maximum seven number of details) in the gallery control as shown above.

PowerApps get details that are following by the user

  • In PowerApps Twitter, to retrieve all the details that are following by the user, you can insert the below formula on gallery’s Items property as:
Items = Twitter.Following(
    "@SahuS93336854",
    {maxResults: 7}
)

Refer to the below screenshot.

twitter connector in powerapps
  • Once you will save and preview the app, you can see the result (maximum seven number of details) in the gallery control as shown above.

PowerApps get information about a user

Here I will discuss some of the twitter function examples that how you can get the information about a user using PowerApps Twitter connection. Check out the below scenarios. For all the scenarios, you can take a Label control and display the result over there.

Example – 1: (PowerApps Twitter get User ID)

In this scenario, We will see how to get the twitter user ID in PowerApps.

  • Select the label and set its Text property to the below code as:
Text = "Twitter User ID: " & Twitter.User("@SahuS93336854").Id
PowerApps Twitter
PowerApps Twitter
  • When you will save and preview the app, the specific user Id will display in the label control as shown below.

Example – 2: (PowerApps Twitter get total Friends)

In this scenario, We will see how to get the total number of friends in PowerApps twitter.

  • Select the label and set its Text property to the below code as:
Text = "Twitter Total Friends: " & Twitter.User("@SahuS93336854").FriendsCount
Power Apps Twitter
  • When you will save and preview the app, the total number of friends will display in the label control as shown below.

Example – 3: (PowerApps Twitter get User Full Name)

  • To get the twitter user full name in PowerApps, apply the below formula on Label’s Text property as:
Text = "Twitter User Full Name: " & Twitter.User("@SahuS93336854").FullName

Refer to the below screenshot.

twitter connector in power apps
  • Just save and preview the app. You can see the result (like Preeti Sahu) in the label control as shown in the above screenahot.

Example – 4: (PowerApps Twitter get User Profile Image URL)

  • To get the twitter profile image url in PowerApps, apply the below code on the Label’s Text property:
Text = "Twitter User Profile Image URL: " & Twitter.User("@SahuS93336854").ProfileImageUrl

Refer to the below figure.

Twitter in PowerApps
PowerApps Twitter get User Profile Image URL
  • Save and preview the app. The specific profile image url will appear as like the above screenshot.

Example – 5: (PowerApps Twitter get User Location)

  • Next, do you want to retrieve the specific user location by using PowerApps Twitter connector? If so, then set the below code on Label’s Text property as:
Text = "Twitter User Location: " & Twitter.User("@SahuS93336854").Location
Twitter in Power Apps
PowerApps Twitter get User Location
  • Once you will save and preview the app, it will show you the location that is specified by the user in twitter account.

PowerApps Twitter Examples

Check out the below simple PowerApps Twitter example.

Send a Tweet in PowerApps

  • This scenario describes how you can post a tweet through the PowerApps easily. For this, We need a Text input control and a Button input that looks like below figure.
  • Here the user will enter the text and tap on the POST button. Once the user will click on it, then the tweet will post in the twitter.
Send a Tweet in PowerApps
Send a Tweet in PowerApps
  • To achieve this, Select the Button control and set its OnSelect property to the below code as:
OnSelect = Twitter.Tweet(
    "",
    {tweetText: txtMyTweet.Text}
)

Where,

txtMyTweet = Specify the text input control name

Send Tweet in PowerApps
Send Tweet in PowerApps

This is how to send a Tweet in PowerApps.

Also, you may like these below Power Apps Tutorials:

In this Power Apps Tutorial, We discussed what is a PowerApps Twitter Connector, How to create the Twitter connection in PowerApps, and its use in the app.

  • Different types of PowerApps Twitter functions
  • Get the User Timeline post in PowerApps Twitter
  • PowerApps Twitter get the Followers
  • PowerApps get details that are following by the user
  • PowerApps get information about a user
    • PowerApps Twitter get User ID
    • PowerApps Twitter get total Friends
    • PowerApps Twitter get User Full Name
    • PowerApps Twitter get User Profile Image URL
    • PowerApps Twitter get User Location
  • PowerApps Twitter Examples
>
Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial

FREE Power Platform Tutorial PDF

Download 120 Page FREE PDF on Microsoft Power Platform Tutorial. Learn Now…