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

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.

I tried to add this to the OnVisible property of my Mainscreen:
Refresh('IMS Working Area');
But this does not resolve the error.