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

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested Answer

Fields retain previous value even when default is blank

(0) ShareShare
ReportReport
Posted on by 182
I have a combo box in a canvas app called cb_Name, it gets populated from a collection <myCollection.Name>
The same field is used to display Name when the user is viewing a record and when a new records is being created.
 
What is happening at the moment is a user is opening the screen to view a records, the cb_Name field is populated with the value from the collection they have selected.
The user exits the screen and the Set(myCollection,Blank()) is triggered, clearing the values from Name.
If the user opens up the same screen again but this time to create a new records, the fields should all be blank as myCollection is blank, but the cb_Name field will be populated with the value that was last in myCollection.Name
 
 The DefaultSelectedItems of the Name field is myCollection.Name
 
How can I ensure the combo box will only display what is in myCollection.Name, so blank when the value is blank. 
Categories:
I have the same question (0)
  • Suggested answer
    Sam_Fawzi Profile Picture
    722 Super User 2025 Season 2 on at
    Fields retain previous value even when default is blank
    Hey @senna,
     
    you need Reset the combo box when switching to “New” mode
     
    like this 
    Set(myCollection, Blank());
    Reset(cb_Name);
    and Make sure DefaultSelectedItems returns Blank when there is no value
    something like this for the defaultSelectedITem property 
    If(
        IsBlank(myCollection) || IsBlank(myCollection.Name),
        Blank(),
        LookUp(
            cb_Name.Items,
            Name = myCollection.Name        // or the appropriate field in your Items
        )
    )
    hope that will help you with your question. 
     
    Cheers,
    Sam

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 724 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
SebS Profile Picture

SebS 239 Moderator

Last 30 days Overall leaderboard