
Hello all,
I have a Power App connected to my Sharepoint Document Library. It consists of 2 screens. One screen consists of the main column properties (FormScreen1) and the second screen is the generation of the Document Number (column) named CreateDocumentNumber.
FormScreen1:
CreateDocumentNumber:
The CreateDocumentNumber screen is connected to a secret Sharepoint List that I need to keep track of which numbers exist. The screen essentially generates a Document Number based on the user's input. This is saved to a LastSubmittedCode variable and is displayed in the Formscreen1. I have designed it that the Document Number can only be generated once, meaning that once an user has pressed on the V of the CreateDocumentNumber screen the value of Document Number will be set and the button becomes inactive.
What I need to do is the following: I found out that if an user hits cancel upon only filling in the Document Number but not the rest and then re-opens the Properties screen that the Document Number property is now empty (which makes sense as the value is only saved into the Sharepoint column once the user completes the whole proces). Therefore the user has to generate the Document Number again, but this will result in 'duplicate' numbers as the user has previously generated a number before and that number was saved to the secret Sharepoint List that keeps track of all the existing numbers.
What I've tried:
In my SharepointIntegration on the OnCancel I tried resetting every field except the Document Number:
This seemed to work on first try, but when uploading a new document and going to the FormScreen1 properties of the new document I saw that the Document Number field did not reset for new documents:
My OnNew property remains unchanged:
Update: I tried this as well on the OnNew property of the SharepointIntegration:
NewForm(SharePointForm1);
If(IsBlank(LastSubmittedCode), Reset(DataCardValue5));
I get this erorr and sadly the behaviour is still the same:
If it might be helpful this is inside the Default field of the Document Number text input:
If somebody can be of any help I'd greatly appreciate it as I'm sadly still pretty new to Power Apps and the only one building the product.
Best wishes, Donna