cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JSivonen
Level: Powered On

Twitter connector - filtering out retweets and replies

Hello experts,

 

is anyone experienced with the Twitter connector? I'm trying to figure out, whether it is possible to pick up only "new tweets" from user's feed. Is it possible to ignore (aka filter out) replies to another tweet and pure retweets? I'm having trouble figuring out the answer, so I'm asking the community for a (possible) shortcut! Smiley Happy

 

Here is the documentation regarding the connector:

https://docs.microsoft.com/en-us/connectors/twitter/

 

What I've done so far is made a twitter account where I post language-translated tweets from another account. The problem is, the replies are especially non-working, since they don't contain a link to the original thread as all @ characters are stripped. Same goes with retweets, I'd like to filter them out as well

1 ACCEPTED SOLUTION

Accepted Solutions
JSivonen
Level: Powered On

Re: Twitter connector - filtering out retweets and replies

I think I got it, after some trial-and-error. This is the condition that leaves only "non-replies":

 

@equals(triggerBody()?['TweetInReplyToUserId'], '')

 

Seems to work Smiley Happy

5 REPLIES 5
JSivonen
Level: Powered On

Re: Twitter connector - filtering out retweets and replies

After looking into the JSON of the tweets, I concluded that I might be able to extract at least replies by filtering out all the tweets where "TweetText" starts with a @ character, which implies to a reply tweet. It's not foolproof, but if there is no parameter or more sophisticated method for this. Smiley Tongue

JSivonen
Level: Powered On

Re: Twitter connector - filtering out retweets and replies

Even better... there indeed is a parameter called "TweetInReplyToUserId" which contains the user ID is the tweet is a reply to some other tweet. But how do I make a expression that needs to be something else than "" aka NULL?

 

@contains(triggerBody()?['TweetInReplyToUserId'], 0)

 

^-- that is "TweetInReplyToUserId contains 0", since the ID's are long numbers which usually contain at least one zero... It's not a proper solution, but better than nothing Smiley Tongue

JSivonen
Level: Powered On

Re: Twitter connector - filtering out retweets and replies

I think I got it, after some trial-and-error. This is the condition that leaves only "non-replies":

 

@equals(triggerBody()?['TweetInReplyToUserId'], '')

 

Seems to work Smiley Happy

NickB1
Level: Power Up

Re: Twitter connector - filtering out retweets and replies

Hey, thanks for this, was facing same challenge.   Can i ask taht you post screenshots of your actual flow with sample data as i struggle to implement the suggested trigger '@equals(triggerBody()?['TweetInReplyToUserId'], '')'

 

Many thanks!

JSivonen
Level: Powered On

Re: Twitter connector - filtering out retweets and replies

I posted the pic on twitter, here: https://twitter.com/jsivonen/status/1084147585424732161

 

Translate tweets with Flow and Azure Cognitive Services

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 89 members 4,280 guests
Please welcome our newest community members: