In this Power Apps tutorial, we will discuss how to show current Weather using connectors MSN Weather in PowerApps.
PowerApps weather app
Here we will see a small example on msn weather app power apps using powerapps weather app connector.
In Power Apps, Microsoft provides an MSN Weather connector to get the current weather status of various countries and states.
This PowerApps Weather app accepts country, city, and Zipcode to get the current weather status.
Fetch current Weather in PowerApps using MSN Weather Connectors
First, we will create a canvas app from the PowerApps.com site.
If you are new to PowerApps Canvas App, check out the below URLs:
- How to Create a Canvas app from SharePoint List in Power Apps
- Create a canvas app from Excel in Power Apps (Step by Step tutorial)
Here create an Power Apps app and you may choose Phone layout or Tablet layout.
Next, go to the Data sources an create a new connection. Here you have to search for MSN Weather which will help us to get the current weather status.
Next, create a new screen and design your page as per your requirement. Here I have designed it in a very simple way.
If you want to continue with the same design, then drag and drop the PowerApps control to show the data.
Once you have created a new screen, go to the OnVisible property of the new screen and add the below code.
UpdateContext({LastLocation : "Doha,QATAR"})
In the above code, you can change the country and state name based on your requirement.
Here, we will add various controls into the PowerApps weather app screen.
Drag and drop the below controls in your Power Apps screen.
1: TxtLocation (TextBox)
Here you have to set the default location =LastLocation
2: Radio Button
Here you have to set the radio button Item property like below
Items ->["Imperial", "Metric"]
3: Search Button
You can add the search button icon from icon list and set the below property in OnSelect.
OnSelect :UpdateContext({Weather: MSNWeather.CurrentWeather(txtLocation.Text, Radio1_1.Selected.Value)})
4: Pressure (Label)
Here you have to set the Text property of the label as below.
Text-> Weather.responses.weather.current.baro & " " & Weather.units.pressure
5: Dew Point (Label)
Here you have to set the Text property of the label as below.
Text->Weather.responses.weather.current.dewPt & " o"
6: Humidity (Label)
Here you have to set the Text property of the label as below.
Text->Weather.responses.weather.current.rh & " %"
7: Sky (Label)
Text ->Weather.responses.weather.current.sky
8: Last Update (Label)
Text->Weather.responses.weather.current.created
9: Wind (Label)
Text ->Weather.responses.weather.current.windSpd & " " & Weather.units.speed
10: Temperature (Label)
Text ->Weather.responses.weather.current.temp & " " & Weather.units.temperature
11: Weather (Label)
Text ->Weather.responses.weather.current.cap
You may like following Power Apps tutorials:
- Fetch Outlook email details Power Apps using Office 365 Outlook Connector
- PowerApps Examples: Restaurant management system
- How to create calculator in PowerApps
- Fetch azure groups in PowerApps using PowerApps Azure AD Connectors
- PowerApps Combobox SharePoint List Example
- How to create a PowerApps Canvas app from Excel OneDrive for Business data source
- How to Play Microsoft stream Videos in Power Apps
- How to view PDF files using PDF Viewer in PowerApps
- How to show RSS feed in PowerApps
- How to embed Power bi report in PowerApps portal
- PowerApps filter SharePoint list Example
- PowerApps Example – Create a Bank Account Statement
Check out the PowerApps video tutorial, we discussed how to create a weather app in PowerApps.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).