I'm working on a weather application using PowerApps as part of a homework assignment. I'm facing challenges while trying to integrate information from your site, as I'm encountering several errors. I would greatly appreciate your assistance in identifying where I may have made a mistake. For instance, when I use the following code:
OnSelect = UpdateContext(
{
WeatherForecast: MSNWeather.CurrentWeather(
txtSearchLocation.Text,
rdUnits.Selected.Value
)
}
)
I encounter an error. Any guidance you can provide would be extremely helpful. Thank you!
Loading
Naimish MakwanaPosted May 27, 2024, 5:26 AM
The code you’ve shared seems to be trying to update the context with the current weather information for a location specified by
txtSearchLocation.Textand units specified byrdUnits.Selected.Value.Here are a few things you could check:
Check the Data Source: Make sure that
MSNWeatheris properly connected as a data source in your PowerApps application. You can check this in theView>Data sourcesmenu in PowerApps Studio.Check the Function Parameters: The
MSNWeather.CurrentWeatherfunction expects two parameters:location(a string) andunits(a string). Make sure thattxtSearchLocation.TextandrdUnits.Selected.Valueare providing the correct values.unitsshould be either"Metric"or"Imperial".Check the Control Names: Ensure that
txtSearchLocationandrdUnitsare the correct names of the controls in your app. PowerApps is case sensitive, so make sure the control names match exactly.Check for Errors in the App: PowerApps Studio will show a red ‘x’ icon next to any errors in your app. Click on this icon to see more details about the error.
If you’ve checked all of these and you’re still encountering errors, it would be helpful if you could provide more details about the error message you’re seeing. This will help in diagnosing the issue further.
Thanks