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 / Problems submitting an...
Power Apps
Answered

Problems submitting an edited record/item

(0) ShareShare
ReportReport
Posted on by 1,625

Hi everyone,

 

This is the first time, in my canvas app I'm allowing users to edit an already submitted request, as this was not a requirement is previous forms.

I'm unsure how I do this.

  • I have deep linking set up, allowing a user to navigate to there submitted record. ✔️
  • Created an edit button for the user to be able to edit the items, edit button on each screen becomes active using 1 variable ✔️
  • The form spans across 5-7 screens, so I assumed I had to use the same code I had on my new form but by doing so it created a new record in my SharePoint list ❌:

 

UpdateContext(
	{
	vPatchedRecord:
	Patch(
		List, Defaults(List),
		FormHome_2.Updates,
 FormPartB_1.Updates,
		'FormPartC/D_1'.Updates,
 'FormPartE/F_1'.Updates,
 FormPartFGH_1.Updates
 ) 
	}
);​

What do I need to do to be able to edit and save to the same submitted record using the above forms please? 

 

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Lefty ,

    Defaults(List) will always create a new record. I cannot test this, but try the below.

    UpdateContext(
     {
     vPatchedRecord:
     UpdateIf(
     List, 
     ID=YourIDIdentifier,
     {
     FormHome_2.Updates,
     FormPartB_1.Updates,
     'FormPartC/D_1'.Updates,
     'FormPartE/F_1'.Updates,
     FormPartFGH_1.Updates
     }
     ) 
     }
    )

     

    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.

     

  • Lefty Profile Picture
    1,625 on at

    HI @WarrenBelz 

     

    Thanks for your response, I have tried the following based on your suggestion, where vRecord is my submitted record, set on my gallery item:

    UpdateContext(
    	{
    	vPatchedRecord:
    	UpdateIf(
     List, ID=vRecord,
    		{
     FormHome_2.Updates,
     FormPartB_1.Updates,
    	'FormPartC/D_1'.Updates,
     'FormPartE/F_1'.Updates,
     FormPartFGH_1.Updates
     }
     ) 
    	}
    );

    Hovering over UpdateIf - "The function UpdateIf has invalid arguments"
    Hovering over the second form:

    updateIf.PNG

    any ideas what I'm missing, or have i missed something you have already provided!

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

    Hi @Lefty ,

    Danger of free-typing - curly brackets not needed for Updates

    UpdateContext(
     {
     vPatchedRecord:
     UpdateIf(
     List, 
     ID=vRecord,
     FormHome_2.Updates,
     FormPartB_1.Updates,
     'FormPartC/D_1'.Updates,
     'FormPartE/F_1'.Updates,
     FormPartFGH_1.Updates
     ) 
     }
    )

     

    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.

  • Lefty Profile Picture
    1,625 on at

    @WarrenBelz 

    Sorry still cant get it to work

     

    getting updateif function has invalid arguments:

    UpdateContext(
    	{
    	vPatchedRecord:
    	UpdateIf(
     List, ID=vRecord,
    	FormHome_2.Updates,
     FormPartB_1.Updates,
     'FormPartC/D_1'.Updates,
     'FormPartE/F_1'.Updates,
     FormPartFGH_1.Updates
     
     ) 
    	}
    );

    sorry, i cannot spot what it needs

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

    @Lefty ,

    Get rid of the UpdateContext for the moment, then add the Updates one at a time.

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

    @Lefty,
    Forget about that - I should test the whole thing together - you need

    UpdateContext(
     {
     vPatchedRecord:
     Patch(
     List, 
     {ID:vRecord},
     FormHome_2.Updates,
     FormPartB_1.Updates,
     'FormPartC/D_1'.Updates,
     'FormPartE/F_1'.Updates,
     FormPartFGH_1.Updates
     )
     } 
    )

     

    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.

  • Lefty Profile Picture
    1,625 on at

    @WarrenBelz 

     

    Thanks

    This is what I have done.

    Removed:

     

    /* UpdateContext(
    	{
    	vPatchedRecord:*/

     

     

     

    UpdateIf(
     Covid, ID=VarID, //I've changed this as i think this needs to be VardID based on my app onstart code
     FormHome_2.Updates
    );

     

    Keeping just this much and it doesnt complaint, tried clicking on the submit button, to see if it takes this 1 update, but clicking the button does not do anything, as my code is not OnSuccess, rather its on OnSelect

     

    Sorry forgot to add, as soon as I add the second form in the code, it starts to complain 

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

    @Lefty ,

    Please read my second post - like a lot of things I do not use a lot, the syntax is not obvious, UpdateIf will only take one FormUpdates, so go back to Patch (which has it s own issues in some cases).

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

    @Lefty ,

     I will be offline shortly due to time zone - I will pick up any responses in the morning.

  • Lefty Profile Picture
    1,625 on at

    Thanks @WarrenBelz 

     

    Sorry, I think your code on this one is correct and the issue I am facing is it won't work for me, because of what I am trying to use in {ID:VarID} or if I use {ID:vRecord}

    Neither work.

    {ID:VarID} i get an error "The specified record was not found. Server Response List failed: Item not found"

    This is what I have on my App OnStart

    Set(VarID, Value(Param("Cov")));
    If(VarID <> 0,Set(vRecord, LookUp(List,ID = VarID));Navigate(ViewScreen));

     I'm not sure if you can help please?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard