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.
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&_nc_cat=106&_nc_ohc=sRbQdob1O5MAX8B1-ff&oh=c3d9aa3fb45c05ca156f2c929ad9eb01&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>
Solved! Go to Solution.
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/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:
Hope this helps.
Best Regards,
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/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:
Hope this helps.
Best Regards,
Thanks. Helps a lot.
I'm just missing the 'compose' step.
Is there an expression to pull out the XML?
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?
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
45 | |
43 | |
38 | |
37 | |
33 |
User | Count |
---|---|
91 | |
85 | |
51 | |
47 | |
38 |