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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapps reset weathe...
Power Apps
Answered

Powerapps reset weather variable

(0) ShareShare
ReportReport
Posted on by 497

Greetings,

I have a SearchInput box and a label.  The intent is to pull in the weather for a selected location based on the user either typing in City, St or toggling to get Lat/Long of their location.

The SearchInput default is:

If(tglLatLongFormNew.Value = true, CurrentLocation, "") 

 

For the label control, the text property  is:

If(frmAddNew.Mode = FormMode.Edit, Parent.Default, "Current temp: " & w2.responses.weather.current.temp & w2.units.temperature & "
"& " Wind Speed: " &w2.responses.weather.current.windSpd & w2.units.speed &"
"& " Conditions: " &w2.responses.weather.current.cap &"
"& " Forecast High: "&w3.responses.daily.tempHi & w2.units.temperature&"
"& " Forecast High: "&w3.responses.daily.tempLo & w2.units.temperature)

 

I have a cancel (X) icon.  Upon OnSelect, I would like the text in the SearchInput to be deleted or Reset AND I would like the weather specific details to be reset.  

 

So, if a user enters Seattle, WA in the SearchInput control and clicks the search icon, the result would be:

Current temp: 37‎°F

Wind Speed: 3mph

Conditions: Light Rain

Forecast High:  43‎°F

Forecast High:  33‎°F

 

If they click the (X) icon, I would ultimately want the label to be reset to the following:

Current temp: 

Wind Speed:

Conditions: 

Forecast High: 

Forecast High:  

 

Any suggestions?

 

weatherToggle.jpg
Categories:
  • bdodu Profile Picture
    399 on at
    OnSelect = UpdateContext({SearchInput: ""}); UpdateContext({label_control: "your_default_text"})

    Where the label_control si the name of your label and your default text is the composed text for empty values.

     

     

  • tianaranjo Profile Picture
    497 on at

    @bdodu - Thank you.  I'm having trouble understanding where I insert the context variables in the SearchInput formula, which is currently: 

    If(tglLatLongFormNew.Value = true, CurrentLocation, "")  

     

    and/or the lblWeatherDetails formula, currently: 

     

    If(frmAddNew.Mode = FormMode.Edit, Parent.Default, "Current temp: " & w2.responses.weather.current.temp & w2.units.temperature & "
    "& " Wind Speed: " &w2.responses.weather.current.windSpd & w2.units.speed &"
    "& " Conditions: " &w2.responses.weather.current.cap &"
    "& " Forecast High: "&w3.responses.daily.tempHi & w2.units.temperature&"
    "& " Forecast Low: "&w3.responses.daily.tempLo & w2.units.temperature)

     

  • Verified answer
    tianaranjo Profile Picture
    497 on at

    @bdodu - you can disregard my last question.  I have resolved with the following:

    SearchInput default formula:

    SearchInput = If(tglLatLongFormNew.Value = true, CurrentLocation, "")

    SearchInput Clear property = true

     

    Label (lblWeatherDetails) text property fx:

    If(IsBlank(inputWeatherSearchFormNew), "Current temp: " & "
    "& " Wind Speed: " &"
    "& " Conditions: " &"
    "& " Forecast High: " &"
    "& " Forecast Low: ", frmAddNew.Mode = FormMode.Edit, Parent.Default, "Current temp: " & w2.responses.weather.current.temp & w2.units.temperature & "
    "& " Wind Speed: " &w2.responses.weather.current.windSpd & w2.units.speed &"
    "& " Conditions: " &w2.responses.weather.current.cap &"
    "& " Forecast High: "&w3.responses.daily.tempHi & w2.units.temperature&"
    "& " Forecast Low: "&w3.responses.daily.tempLo & w2.units.temperature)

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard