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 / How do I get the curre...
Power Apps
Answered

How do I get the current item or current record while in an edit form?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

This feels like such a basic question, but I'm moving between screens in a powerapps form, how do I get the current record? I need it to Patch the item.

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at
    @Anonymous
    If you have clicked on a gallery to open the Edit Form screen you can use: Gallery1.Selected in the 2nd argument of PATCH.

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Well, I have a button that's outside of the form that I want to click and have it edit one of the fields in SharePoint, but for that I need to use Patch and for that I need the current record.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    SubmitForm([@FormEdit]); Navigate(ScreenEdit_2, ScreenTransition.Fade); Set(itemID, ThisItem.ID);

     

    This is what I'm trying to use in my button to get to the second page, but the ThisItem function only works in the form itself.

  • mdevaney Profile Picture
    29,993 Moderator on at
    Thank you for supplying your code. To SET the itemID you can use the LastSubmit property of your form.

    SubmitForm(FormEdit);
    Set(itemID, FormEdit.LastSubmit.ID);
    Navigate(ScreenEdit_2, ScreenTransition.Fade);

    Then on your 2nd screen you can PATCH like this

    Patch(your_datasource_name,LookUp(your_datasource_name,ID=itemID),{your_field1: your_textinput1.Text})

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You know the only concern I have with LastSubmit is, if multiple people are working on the list in SharePoint, isn't it possible that someone could have submitted another form, and that number will then get used instead of the number for the current item?

  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at
    @Anonymous
    It is a common question but I can tell you there is no concern using LastSubmit. The LastSubmit property refers to the last record successfully submitted by the current user. It does look at the datasource to find the latest record created by all users.

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard