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 populate a ne...
Power Apps
Answered

How do I populate a new PowerApps form from last submitted form (SharePoint list)?

(0) ShareShare
ReportReport
Posted on by 13

Hi all 

New to PowerApps, I have built a handover form for my team mates in PowerApps that works well but I would like to streamline it a bit.

At the moment they submit the form and start a new blank form, I would like to copy information from the last saved form to pre-populate different text fields in the new form.

This will save them from having to copy and paste the data across.

On submit the data is saved into a SharePoint list.

I have tried reseting card values but on submit it just overwrites the SharePoint entry with new card values and does not start a new entry.

 

Is this possible? 

If so any information would be great.

Thanks in advance 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SccP72 

    Yes, this is possible.  You will need to alter the Default property for each DataCard that you wish to exhibit this action.

    In the default consider the following formula (again, applied to each data card where you need it):

    If(
     !IsBlank(yourEditForm.LastSubmit.ID), yourEditForm.LastSubmit.yourColumnName,
     ThisItem.yourColumnName
    )

    Obviously, replace yourEditForm in the above with your EditForm name and yourColumnName with the name of the column you want to duplicate.

    This assumes simple column types (text, number, etc). 

     

    I hope this is helpful for you.

  • SccP72 Profile Picture
    13 on at

    Thanks for the quick reply 🙂 i will try it now.

  • SccP72 Profile Picture
    13 on at

    Thanks again

     

    Worked like a charm, after i worked out the need to save the form before the fields will fill 😉 

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi there,

     

    I know this thread is old but hopefully you see this.

     

    I am looking to do the same thing as you and I changed the code as suggested by the other user. Whilst changing the default in the data cards the information from the previously submitted form appeared. I saved the app and the next day went to trial it but the data from the previously filled in for doesn’t appear anymore even after submitting the form?

     

    Any help would be greatly appreciated.

     

    Thanks,

    Gemma

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, that is an old thread.  Are you still having the issue?  If so, I would start a new thread on the forum and reference this posting if it is relevant.  That will get you some quicker looks and results.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi All

     

    Apologies this is an old thread and perhaps I should be using a new one. I have a similar situation described in this post and I tried the suggestion. This works well for text cards but it seems to fail for cards with combo boxes/drop downs and dates. 

     

    I would be grateful if you could please share your approaches to move data from the previous form to the new one with other forms of data type.

     

    Thank you very much for your help.

     

    Regards

  • iwonder Profile Picture
    1,146 on at

    Thank you so much for posting this @RandyHayes I've been trying to solve this on my own and finally came across this post! BRILLIANT! I just may be done work early today!

     

    have a great weekend

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @iwonder 

    Actually...times have changed. There's an even easier way.

     

    If you are just wanting to populate the form with the last submitted data, then:

    1.  Make sure the FormMode is Edit (and you will not use New any longer as it is not relevant)

    2.  In your OnSuccess action of the form, the following formula:  Set(glbCurrentRecord, Self.LastSubmit)

    3.  In the Item property of the form, the following:  Patch(Coalesce(glbCurrentRecord, Defaults(yourDataSource)), {ID: Blank()})

     

    That is it!  Now when you go to the form for the first time, it will be a new form ready for input.  After you submit, the form will now be a New record as well, but all the fields will be filled in with the previous values.

     

    Maybe with that, your work will be done even sooner!  

    Have a great weekend as well.

     

  • iwonder Profile Picture
    1,146 on at

    Thanks again @RandyHayes 

     

    I had just finished updating all my data cards... 🙂

     

    I don't understand #3: Patch(Coalesce(glbCurrentRecord, Defaults(yourDataSource), {ID: Blank()})

     

    Why do we Patch() in the Items of the Edit Form? Don't we only Patch() when saving a record?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @iwonder 

    No, Patch is a function that patches records.  If you specify a datasource for patch, then it knows to interact with a datasource.  Otherwise, it patches records.

    So in #3:

    First, we get the record that we want with the Coalesce function.  This will return the first record that is not blank.

    So the first time, glbCurrentRecord will be blank and thus this will return the Defaults record for the datasource. (if there are no default values for the list, that can actually all be removed)

    Second, we take that record from the Coalesce and patch it with another record.  The other record is just simply {ID: Blank()}

    This will essentially just blank out the ID column.  

    When you submit the form, if the ID is blank, then it knows to create the record.  If it has a value, then it knows to update that record (same thing Patch does when working with a datasource by the way!)

     

    So, by doing the patch, we are taking (after the first submit) the record that was last submitted, which will have ALL of the values submitted, and then we blank out the ID.  This way, the form now has all the values from the previous submit, but since we just blanked out the ID, when it is submitted, it will be a new record that is created.

     

    Hopefully that is pretty clear to understand.  But, a takeaway, Patch is a multi-use function and is very powerful in PowerApps for modifying data in the app and even reshaping it.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard