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 / Field in Power App is ...
Power Apps
Answered

Field in Power App is not reset to Parent.Default without manually refreshing

(0) ShareShare
ReportReport
Posted on by 427

Hello, 

I have a text field in my Power App form that looks like this:

DJanssen_1-1706684628070.png

Default property:

If(
 !IsBlank(ExistingDocumentNumbersDropdownValue.Selected.'Doc Reference'),
 ExistingDocumentNumbersDropdownValue.Selected.'Doc Reference',
 If(
 !IsBlank(LastSubmittedCode), 
 LastSubmittedCode,
 Parent.Default
 )
)

When clicking on Create Document Number the user will be navigated to a second screen where the Document Number will be generated and set in a variable:

Set(LastSubmittedCode, GeneratedDocumentNumber.Text);

However this lead to the following behaviour; if I upload 2 documents and assign a document number to the first document that same document number will be shown as LastSubmittedCode when I open the properties of the second document. This only goes away by manually refreshing, but this will confuse users and I want to this field to basically default to Parent.Default (which is empty standard) when opening the Power App on any new document.

DJanssen_0-1706684600966.png

I tried to add this to the OnVisible property of my Mainscreen:

Refresh('IMS Working Area');

But this does not resolve the error. 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    Hi @DJanssen ,

    Firstly you can condense that to 

    Coalesce(
     ExistingDocumentNumbersDropdownValue.Selected.'Doc Reference',
     LastSubmittedCode,
     Parent.Default
    )

    but you need to reset the control if you want it to refresh the data.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • DJanssen Profile Picture
    427 on at

    Hi @WarrenBelz ,

     

    Thanks for your suggestion. That looks a lot shorter and better readability. A question regarding the resetting of the form. Currently the DocumentNumberTextValue has the following Reset property:

    DJanssen_0-1706687167078.png

    Do I simply need to set this to true?

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @DJanssen 

     

    you can also try this:

    // Assuming this is your button's OnSelect property
    ClearCollect(
     GeneratedDocumentNumberCollection, // Create a collection to hold the generated document number
     {
     DocumentNumber: GeneratedDocumentNumber.Text
     }
    );
    
    Set(LastSubmittedCode, First(GeneratedDocumentNumberCollection).DocumentNumber);
    
    Navigate(SecondScreen, ScreenTransition.None);

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    @DJanssen ,

    Easiest way is to set the Reset property to a Variable (example varReset ) then use a Global Variable if you are switching screens

    . . . . .
    Set(
     LastSubmittedCode, 
     First(GeneratedDocumentNumberCollection).DocumentNumber
    );
    Navigate(
     SecondScreen, 
     ScreenTransition.None
    );
    Set(
     varReset,
     false
    );
    Set(
     varReset,
     true
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • DJanssen Profile Picture
    427 on at

    Hi @mmbr1606 ,

    I looked at your suggestion but my GeneratedDocumentNumber.Text is always predefined:

    DJanssen_0-1706699472442.png

    This is because in the second screen in between the dashes the Document Number is built. The Default value of this field in the second screen is:

     

    Concatenate(CompanyNameText & "-" & TeamCodeDropdown.Selected.TeamCode & "-" & DisciplineCodeDropdown.Selected.DisciplineCode & "-" & DocumentTypeCodeDropdown.Selected.DocumentTypeCode, If(!IsBlank(AttachmentTypeCodeDropdown.Selected.DocumentAttachmentTypeCode), "-" & HasAttachmentDropdown.SelectedText.Value & "-" & AttachmentTypeCodeDropdown.Selected.DocumentAttachmentTypeCode & "-" & SequentialNumber2, "-" & SequentialNumberValue))

     

    DJanssen_1-1706699671052.png

    I'm aware that this is not the prettiest code, but I'm the only one building this Power App form and still pretty new to the Power Platform 😉

    Update: I have added code to make this field an empty string until the choices are filled in. Will try your solution now!

    If(IsBlank(TeamCodeDropdown.Selected.TeamCode) && IsBlank(DisciplineCodeDropdown.Selected.DisciplineCode) && IsBlank(DocumentTypeCodeDropdown.Selected.DocumentTypeCode), "", Concatenate(CompanyNameText & "-" & TeamCodeDropdown.Selected.TeamCode & "-" & DisciplineCodeDropdown.Selected.DisciplineCode & "-" & DocumentTypeCodeDropdown.Selected.DocumentTypeCode, If(!IsBlank(AttachmentTypeCodeDropdown.Selected.DocumentAttachmentTypeCode), "-" & HasAttachmentDropdown.SelectedText.Value & "-" & AttachmentTypeCodeDropdown.Selected.DocumentAttachmentTypeCode & "-" & SequentialNumber2, "-" & SequentialNumberValue)))

     

  • DJanssen Profile Picture
    427 on at

    Hi @WarrenBelz ,

    Could you maybe elaborate on your solution. I currently  have the following on my Reset field in my Power app:

    DJanssen_0-1706702112186.png

    So a the variable that you mentioned. 

     

    On my OnSelect button I have: 

    ClearCollect(
     GeneratedDocumentNumberCollection, // Create a collection to hold the generated document number
     {
     DocumentNumber: GeneratedDocumentNumber.Text
     }
    );
    
    Set(LastSubmittedCode, First(GeneratedDocumentNumberCollection).DocumentNumber);
    If(!IsBlank(MainScreenTitleValue), Navigate(CreateDocumentNumber), Notify("Please fill in the Title field before proceeding", NotificationType.Error));
    Set(varReset, false);

     

    Where do I set the varReset to true? I think on the second screen exactly on the moment where I set the LastSubmittedCode  and submit the data of the second screen to a list right?

  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    @DJanssen ,

    You need to set it to true directly after you set it to false - a Reset is triggered by changing a Variable from false to true. If you are confident it is false before you start the code, just set it to true.

    Also please tag who you want to respond - three way conversations confuse everyone.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • DJanssen Profile Picture
    427 on at

    @WarrenBelz Ah I see. I tried your solution with the 2 condition resets when triggering the button. But this still did not work. Is there any other way? 
    Currently on my button Create a Document Number:

    ClearCollect(
     GeneratedDocumentNumberCollection, // Create a collection to hold the generated document number
     {
     DocumentNumber: GeneratedDocumentNumber.Text
     }
    );
    
    Set(LastSubmittedCode, First(GeneratedDocumentNumberCollection).DocumentNumber);
    If(!IsBlank(MainScreenTitleValue), Navigate(CreateDocumentNumber), Notify("Please fill in the Title field before proceeding", NotificationType.Error));
    Set(varReset, false);
    Set(varReset, true);
  • Verified answer
    DJanssen Profile Picture
    427 on at

    Hello a quick update. I managed to get it working by placing a TextLabel over the original input. I also reset the LastSubmittedCode to blank on the OnSave SharepointIntegration property. I think only the last thing could have solved the original problem anyways. Happy to have it working at least!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard