0
votes

We have a powerapps SharePoint List form where there is a button in the New Item Form.

On Click of said button, the item needs to be saved and should redirect to the Edit item form for the same item.

We tried IF(SubmitForm(NewForm),Navigate(EditForm)) in the button click properties.

On clicking the button the item got saved. But instead of opening the Edit form of the saved item, it is opening the Edit Form of whatever item got edited last in the list.

Please help

1

1 Answers

2
votes

Try this:

  • Connect your Sharepoint list to the Form
  • Submit Button:
    • OnSelect: SubmitForm(<FormName>)
  • Form properties:
    • OnSuccess: Set(varLastSubmit, <FormName>.LastSubmit)
    • Item: If(!IsBlank(varLastSubmit),varLastSubmit)

enter image description here

Caveat:

  • This solution assumes you ALWAYS want to ONLY edit the last submitted record
  • To get "out of the loop", you'll need to hit the Reset button (NewForm(<FormName>)

enter image description here - If you delete the record you're currently working on, this will throw an error "Item not found" and you'll need to hit the Reset button as well