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 / Variable default value...
Power Apps
Unanswered

Variable default value erases manual value when source changes

(0) ShareShare
ReportReport
Posted on by 21

So I have a setup where one combo box uses the selection of another to set its default value. It is a very simple code:

 

If (!(DataCardValue77.Selected.Value = "No App Impacted"), First(Choices([@SourceName].Issue, "Software/Application) 

 

This works fine. But the problem I am facing is that when the user has manually selected a value in this combo box, and then changes the source control (DataCardValue77) it resets the control to the new default. I was under the impression that the default value only mattered if you hadn't put in a value but this seems to not be the case. Is there a work around for this so that it will only change if the combo box had no value selected?

 

Any help would be appreciated.

Categories:
  • DrKEWatson Profile Picture
    21 on at

    So I found that if I do an OnChange for the source combobox to set a variable to be either the current selected record in the second combobox or if the second combobox is empty set the variable to the default I want ("Software application") I can then use the variable to be the default value. This means that if a value is alredy present it will become the default if I change the source combo box but if no value is selected it will default it to the right value. I just have to make sure I reset the variables to an empty record after submitting or clearing the form.

     

    But it works.

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 234 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