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 to save the record...
Power Apps
Answered

How to save the record in a variable after Submitting a New Form

(0) ShareShare
ReportReport
Posted on by 61

The Item property of my form is varAuditSelected.

When I have the form in New Mode, and I submit the form for the first time, I would like to capture the new record that was created into the varAuditSelected variable so that I can immediatly start editing that record.

 

In other words i am trying to find a way to go from the creation of a new record straight to a form editing that record without going through a gallery selection first.

 

ideas?

Categories:
  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi @schuess2 ,

     

    You can potentially leverage the LastSubmit property of the form - this contains the last successful record saved to the source and, more importantly, any source-relevant/created data is returned as well - such as the ID of the record that something like SharePoint might auto-create for you.

     

    Let's assume you have two edit forms on the page - "MyNewForm" and a "MyEditForm" 


    You can use your MyNewForm's OnSuccess:  property to set EditForm(MyEditForm), the Item: of which can be set to 

    MyNewForm.LastSubmit 

    When you submit something on MyNewForm, the EditForm will automatically be populated with the newly submitted record.

     

    Hope this helps,

     

    RT

  • schuess2 Profile Picture
    61 on at

    @RusselThomas you rock!

     

    Took me a second to figure out how to use it. For anyone else that finds this post, Documentation is located here.  https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail (very little documentation)

     

    So what i did was Set my form items property to a variable

    then when i click a save button (no navigation attached)

    I use the OnSuccess property with the following:

    variable = FormName.LastSubmitt 

     

    outcome, the form automatically switches to edit mode. 

    thanks again. 

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard