cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lmcginnis
Level: Powered On

MSN Weather from ComboBox Data Selection howto?

Hi,

Trying to automate functions in my app, and on my 1st page I have a combo box connecting to a database, then I pull the tables out as needed through out the APP based on that selection.

I am now trying to link that combo box to MSN weather, in a button that will take me to a new page were I will pull out the information I want into lables... it's not working tho 😞

Here is the last thing I tried,

UpdateContext({Weather: MSNWeather.CurrentWeather(Concat(ComboBox1_1.SelectedItems, 'Location Address' )}) & Navigate('Current Weather',ScreenTransition.Fade)

 

If you can help, THANKS! 🙂

2 REPLIES 2
Community Support Team
Community Support Team

Re: MSN Weather from ComboBox Data Selection howto?

Hi @Lmcginnis ,

Could you please share a bit more about the formula you typed within the Items property of the ComboBox?

Further, do you want to retrieve the Weather data based on the selected items within your ComboBox?

 

Based on the formula that you provided that you mentioned, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:5.JPG

Set the OnSelect property of the "Collect" button to following:

ClearCollect(
WeatherCollection,
MSNWeather.CurrentWeather(Location.Latitude&","&Location.Longitude, "Metric").responses.weather.current
);
Navigate('Current Weather', ScreenTransition.None)

On your side, you should type the following formula:

Set(  /* <-- Please use Set function to store the variable instead of UpdateContext function */
      Weather, 
      MSNWeather.CurrentWeather(Concat(ComboBox1_1.SelectedItems, 'Location Address'), "Metric").responses.weather.current
);
Navigate('Current Weather', ScreenTransition.None)

Note: If you want to use the the Weather variable within your another screen ('Cureent Weather'), please consider store the value into a global variable using Set function instead of UpdateContext function.

Then within your 'Current Weather' screen, you could reference the values from the Weather variable.

 

In addition, there are some limits with the first argument (Location) of the MSNWeather.CurrentWeather() function, the valid inputs are City, Region, State, Country, Landmark, PostalCode, and Lat.Long.

Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/msnweather/#get-current-weather

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Lmcginnis
Level: Powered On

Re: MSN Weather from ComboBox Data Selection howto?

Sorry for the late reply,

 

So my original combow box contains site information, name/address/phone number/etc//etc..

So I've got that on my 1st page as a selection, and every page after uses that information to give options that are related to that choice.

And yes, I would like to use to continue to use the the combo box in this fashion for the weather.

 

So In order to get you suggestion work, so I can test it, I have been looking for the way to pull the information out via lables, and I have not found a way to do this with the given example above. If you get a minute could you show me how by pulling that information (and I am going to use the set function), to load the new page and the have a lable show tempature ... from there I could recreate each instance I'd like to pull out. Thanks, Lance

 

 

**edit

Also I think I just broke it trying to correct the location address to a valid field, using my stored lat. and lon. fields pulled from the data attached to my combo box.. 

Set( /* <-- Please use Set function to store the variable instead of UpdateContext function */
Weather,
MSNWeather.CurrentWeather(Concat(ComboBox1_1.SelectedItems, Location.'Lat.'&","&Location.'Lon.'), "Metric").responses.weather.current
);
Navigate('Current Weather', ScreenTransition.None)

 

I am not sure of the correct syntax, sorry...

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,814)