cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

New screen creates new record

I have a simple sharepoint list which I have build a number of screens on using a canvas app. The user completes screen 1 and moves to screen 2 to continue and so on. Basically just broke it up into 5 screens to separate the content. I do have a Save button which allows the user to save a screen and return to the main/welcome screen. But each screen also has a button to Patch data to the sharepoint list and then navigate to the next screen to continue, if they choose to. The problem is, when the button is pressed on screen 1 to patch and go to screen 2, while the record is saved, it also creates a new record and the data in screen 2 is saved to that new record rather than the initial record. I have an ID field which is populated by power Automate taking the built in ID and appending a prefix to it. So the ID I am using isn't populated in the record immediately. It takes a little while. But I don't necessarily think that has anything to do with the problem. 

My button code is:
Patch('SharePoint_List_Name',varFormData,Form1Name_frm.Updates);
If(
IsEmpty(Errors('SharePoint_List_Name')),
Navigate(Form2Name_frm),
Notify(
First(Errors('SharePoint_List_Name')).Message,
NotificationType.Error
)
)
 

When this is done, a new SharePoint record is created the data entered in screen 2 is saved to the new record, not the record I started with in screen 1.

 

FYI, the reason I am patching in each screen instead of all at once at the end is because the user will not necessarily complete all screens at once. They may leave and come back later to continue. 

 

Any thoughts/help would be appreciated.

1 REPLY 1
Drrickryp
Super User
Super User

@Anonymous 

If you are using forms, there should be no need to use Patch().  Please review the best video on how to use forms in Powerapps, produced by @RandyHayes  here:  https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwj9gaGqjuz3AhVbDkQIHartA08QtwJ6BAgOEAI&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dw724AECyMxo&usg=AOvVaw3_XhEI_JDeEfiOC8h4J5TN 

It will be well worth the time it takes to see it and will save you hours of frustration if you continue on the path you have started for yourself. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,620)