web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / XML data gathering not...
Power Automate
Suggested Answer

XML data gathering not working

(1) ShareShare
ReportReport
Posted on by Microsoft Employee
I am trying to pull weather information from the National Weather Service website for the forecast information for my area. They have an XML link available on the page that I am using an HTTP request to grab the XML data, but when I try to use xpaths to separate out the data I can't get all the information in the XML. I've tried using composes and variables, but it still won't grab the full week's worth of data.
 
The end goal for this is parsing out the information for each day so that it can be used to send out an email to our team for that week's weather and any potential hazards upcoming (weekly recurrence on Monday morning).
 
Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I would use the Get Current Weather action in Power Automate. Parsing XML data is challenging to say the least with Power Automate. With the action you just specify the location and choose your unit of measurement. It returns over 30 pieces of detail about the weather for that location.

    Here are details of the action: MSN Weather - Connectors | Microsoft Learn
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    If you don't want to go with my suggestion about the weather action, what have you done so far to extract the XML data. I am by no means an expert, but I needed to get XML data from a Nintex form's repeating section.
    1. First pass the XML data through a Compose action.
    2. Then add another Compose action and enter this expression to convert the output of the above action to JSON: json(xml(outputs('Compose')))
    3. Add a condition to check if the data is an array: contains(string(outputs('Compose_Convert_to_JSON')),'"Items":{"Item":[')
    4. Then on each side of the condition, add a Parse JSON action on the output of the converted data.
     
    This is what it looks like in one of my flows:
    My XML data is rather simple. I am guessing the weather data XML will be much more complex so this may not work or may pose more challenges than I had. this is how simple my XML data is:
    <?xml version="1.0" encoding="utf-8"?><RepeaterData><Version>1.0</Version><Items><Item><_742b7b5ba81990ff42f64375dfdbf9ce type="System.String">1572</_742b7b5ba81990ff42f64375dfdbf9ce><_07ad023fa1054202079382704836c26d type="System.Int64">1</_07ad023fa1054202079382704836c26d><_b7d170afb19bdfe87ef25ff3aa566ada type="System.String">176239869</_b7d170afb19bdfe87ef25ff3aa566ada></Item></Items></RepeaterData>
     
  • Suggested answer
    WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at
    Yeah seriously, just convert that to JSON and work with that - it's a million times easier. There are a few niche little things you can do in xpath that don't have corresponding functions in Power Automate/Logic Apps but in your use you can likely do everything you nneed by converting that document to JSON then use filter, select or whatever to transform the data how you want.

    It's a complicated data structure but you can parse it to produce a table using JSON functions e.g

    Convert to JSON

    Make a 7 day range
    Convert it to an object

    Filter for the time layout you want

    Grab your min temps

    And your max temps
    Day names

    Put it all together


    The result:


    Now just expand this solution to include other things from the forecast such as the probability of precip or whatever.

    I appreciate this is hard to replicate based on screen shots so I give you the flow to get you started, DM me for that because I can't attach it here. Good luck,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard