Skip to main content

Notifications

Community site session details

Community site session details

Session Id : dqPL2ymsZdaQz8omLFcUxc
Power Apps - Building Power Apps
Answered

Showing current temperature on page

Like (1) ShareShare
ReportReport
Posted on 22 Nov 2021 04:04:00 by 121

Hi team,

I'm wanting to return current weather conditions to a page on my app, starting simple such as the current temperature.

 

I have found the free MSN Weather connector, however this appears to require manual entry of a location to return weather details. I'm wondering if anyone has any ideas how I would be able to use the inbuilt location functions of PowerApps to have the MSN weather connector return the temperature at the location of where the user device is?

 

Thanks in advance!

  • Marty_Dub Profile Picture
    121 on 22 Nov 2021 at 05:52:51
    Re: Showing current temperature on page

    Thankyou @WarrenBelz - that worked perfectly.

  • Verified answer
    WarrenBelz Profile Picture
    146,751 Most Valuable Professional on 22 Nov 2021 at 05:25:49
    Re: Showing current temperature on page

    Hi @Marty_Dub ,

    I can give you what a use for the weather today and tomorrow at a location - first set a Variable (after connecting MSN Weather

    UpdateContext(
     {
     varWeatherToday: MSNWeather.TodaysForecast(
     Location.Latitude & "," & Location.Longitude,
     "Metric"
     ).responses,
     varWeatherTomorrow: MSNWeather.TomorrowsForecast(
     Location.Latitude & "," & Location.Longitude,
     "Metric"
     ).responses,
     varWeather:true
     }
    )

    then a HTML box

    "<h3><u>Today</u></h3>
    <p><b>Location: </b>" & varWeatherToday.source.location & "</p>
    <p><b>Forecast:</b><br>" & varWeatherToday.daily.day.summary & "</p>
    <p><b>Temperature (Day):</b> &nbsp;&nbsp; Low: " & varWeatherToday.daily.tempLo & "&nbsp;&nbsp; High: " & varWeatherToday.daily.tempHi & "</p>
    <p><b>UV Index:</b>&nbsp;&nbsp;" & varWeatherToday.daily.uv & " (" & varWeatherToday.daily.uvDesc & ")</p>
    <p><b>Wind:</b>&nbsp;&nbsp;" & varWeatherToday.daily.day.windSpd & " kph (max " & varWeatherToday.daily.windMax & ") from " & varWeatherToday.daily.day.windDir & " Degrees</p>
    <p><b>Conditions:</b>&nbsp;&nbsp;" & varWeatherToday.daily.day.cap & "</p>
    <h3><u>Tomorrow</u></h3>
    <p><b>Forecast:</b><br>" & varWeatherTomorrow.daily.day.summary & "</p>
    <p><b>Temperature (Day):</b>&nbsp;&nbsp;Low: " & varWeatherTomorrow.daily.tempLo & "&nbsp;&nbsp; High: " & varWeatherTomorrow.daily.tempHi & "</p>
    <p><b>UV Index:</b>&nbsp;&nbsp;" & varWeatherTomorrow.daily.uv & " (" & varWeatherTomorrow.daily.uvDesc & ")</p>
    <p><b>Wind:</b>&nbsp;&nbsp;" & varWeatherTomorrow.daily.day.windSpd & " kph (max " & varWeatherTomorrow.daily.windMax & ") from " & varWeatherTomorrow.daily.day.windDir & " Degrees</p>
    <p><b>Conditions:</b>&nbsp;&nbsp;" & varWeatherTomorrow.daily.day.cap & "</p>"

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,751 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started