cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
n1cks
Frequent Visitor

RSS (XML) to Twitter with a photo

Below is a snippet of the XML from an RSS feed. 

I would like to post a Tweet with an image. 

The link to the image is in the enclosed URL tag (replace the & with & to view the image).  

E.g.

https://scontent-ort2-2.cdninstagram.com/v/t51.2885-15/e35/83656913_122453209286778_2085275534449482...

 

I see the option to 'add dynamic content', but need help with making an expression. 

Thanks in advance. 

 

<item>

<title>This place looks amazing</title>
<link>   </link>
<dc:creator>      </dc:creator>
<pubDate>Tue, 04 Feb 2020 07:02:12 PST</pubDate>
<guid isPermaLink="true">     </guid>

<description>

This place looks amazing
</description>

<enclosure url="https://scontent-ort2-2.cdninstagram.com/v/t51.2885-15/e35/83656913_122453209286778_2085275534449482794_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com&amp;_nc_cat=106&amp;_nc_ohc=sRbQdob1O5MAX8B1-ff&amp;oh=c3d9aa3fb45c05ca156f2c929ad9eb01&amp;oe=5EC347FA" length="0" />

<activity:object-type xmlns:activity="http://activitystrea.ms/spec/1.0/">http://activitystrea.ms/schema/1.0/photo          </activity:object-type>
						
<activity:verb  xmlns:activity="http://activitystrea.ms/spec/1.0/">http://activitystrea.ms/schema/1.0/post    </activity:verb>

<georss:featureName xmlns:georss="http://www.georss.org/georss">Bolton Abbey   </georss:featureName>
					

</item>

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @n1cks ,

 

The best option to extract this data is to use xpath() function to parse the feed and get the URL.

Please check this similar thread and see if it helps:

https://powerusers.microsoft.com/t5/General-Power-Automate/help-with-Xpath-and-Soap-message/td-p/322...

https://powerusers.microsoft.com/t5/Building-Flows/Iterate-XML-with-flow/m-p/163734#M16546

 

Besides, you could also use the WDL function to extract the URL, try to use the following expression:

split(split(outputs('Compose'),'<enclosure url="')[1],'" length="0" />')[0]

Image reference:

22.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

 

Hi @n1cks ,

 

The best option to extract this data is to use xpath() function to parse the feed and get the URL.

Please check this similar thread and see if it helps:

https://powerusers.microsoft.com/t5/General-Power-Automate/help-with-Xpath-and-Soap-message/td-p/322...

https://powerusers.microsoft.com/t5/Building-Flows/Iterate-XML-with-flow/m-p/163734#M16546

 

Besides, you could also use the WDL function to extract the URL, try to use the following expression:

split(split(outputs('Compose'),'<enclosure url="')[1],'" length="0" />')[0]

Image reference:

22.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks. Helps a lot. 

 

I'm just missing the 'compose' step.  

 

Is there an expression to pull out the XML? 

 

Screenshot (4).png

 

 

Edit: 

I got this to work - my flow extracts the image URL from an RSS feed.  But it turns out, the media field in the Post a Tweet action doesn't accept image URL.  Any ideas? 

 

 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,425)