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 / Prepopulate form with ...
Power Apps
Answered

Prepopulate form with Values from Last Submitted Form

(0) ShareShare
ReportReport
Posted on by 12

I have a form that is connected to a SharePoint list as its data source.

 

I'd like users to be able to submit a form with information, and if they want to submit another form with mostly the same information, they hit a toggle, submit the form, and only have to fill out minimal information in the next form and create a new item on the SP list.

 

For example, a colleague wants to submit a request for a meeting on December 1, at 10:00am, with the Title "Staff Meeting", and Setup of "10 chairs". He also wants to submit a request for a meeting on December 2, at 2:00pm, with the Title "Staff Meeting", and Setup of  "10 chairs".

 

I want him to be able to fill out the form for Dec. 1, check the "Submit another request with similar request information" toggle, submit the form, and then another form is populated with values from the first submit, but it would be for a new item on the SP list, not editing the first submitted item. 

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

    @tinoac123 

    Consider changing the Default property of the datacards for the fields you want to pre-populate.  Set the formula to the following:

       If(yourToggle.Value, yourFormName.LastSubmit.fieldName, ThisItem.fieldName)

     

    Substitute the name of your toggle and the name of your fields.

     

    I hope this is helpful for you.

  • tinoac123 Profile Picture
    12 on at

    @RandyHayes  would the DefaultMode of my form be FormMode.New?

     

    Also, whenever the form is submitted, a new form doesn't appear. It just says "No Data to Display"

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

    @tinoac123 

    I would just suggest in the OnSuccess action of the Form, that you check the status of your toggle.  If it is on, then start a new form.

    ex.   If(yourToggle.Value, NewForm(yourFormName), Navigate(somewhereelse))

     

    In the above it was either start a new form or navigate someplace else.  You can substitute as needed.

     

    Setting the DefaultMode simply tells the form what mode to be in by default.  If you use commands like EditForm, NewForm, ViewForm - these will all set the mode of the form accordingly.

     

     

  • tinoac123 Profile Picture
    12 on at

    @RandyHayes  i followed your steps here, however it's not working. I've set the OnSuccess property of my form to 

    If(Toggle7.Value=true, NewForm('New Hold Form'),
    Toggle7.Value=false, Navigate(SuccessfulSubmission,ScreenTransition.Fade))

     

    I've set the Title field of my form to 

    If(Toggle7.Value=true,'New Hold Form'.LastSubmit.Title,
     Toggle7.Value=false, Parent.Default)

     
    After submitting the form, the Title field prepopulates for a second, but then disappears and it's a blank/new form.

     

    Any other ideas?

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

    @tinoac123 

    Yeah, your last submit is probably getting cleared since you must have your form in New mode as default.

     

    So do this, in the OnSuccess set the formula to:

    If(Toggle7.Value, 
     Set(glbLastResults); NewForm('New Hold Form'),
     Navigate(SuccessfulSubmission,ScreenTransition.Fade)
    )

    By the way, the above works fine, you don't need the redundant true and false parts you had.

     

    Then, change your Title datacard (and others) to the following formula:

    If(Toggle7.Value, glbLastResults.Title, Parent.Default)

    Again, no need for true and false statements, it is implied.

     

    That should get you what you want.

  • tinoac123 Profile Picture
    12 on at

    @RandyHayes  Your OnSuccess formula threw me an error. You have a Set function but not setting it to anything? "Invalid number of arguments: received 1, expected 2" Am I supposed to set it to 'New Hold Form'.LastSubmit?

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

    @tinoac123 

    Duh...sometimes the little hamster in my head falls asleep in his wheel...

     

    Yes, formula should be:

    If(Toggle7.Value, 
     Set(glbLastResults, 'New Hold Form'.LastSubmit); NewForm('New Hold Form'),
     Navigate(SuccessfulSubmission,ScreenTransition.Fade)
    )

    Sorry for the confusion...hamster is awake now!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard