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 / Display Form - No Item...
Power Apps
Answered

Display Form - No Item to Display

(0) ShareShare
ReportReport
Posted on by 41

I have a display form which is set up to show the last submitted data sent to a Sharepoint List.

 

However I also am using a variable on the submission button which retains the last submitted data in the fields (so that the user does not need to keep typing the same data in each time).

 

The issue I'm having is that once I submit a new entry to Sharepoint, and the data is sent to Sharepoint (as well as re-populated in the form), the display form won't display the previous record. This may be because I have a NewForm triggered in the OnSuccess property of the Edit form. 

 

What I think may be happening is that the record is filled out, the user hits submit, the item is added to the Sharepoint list, the data just sent to SP is also re-populated in the input fields, Form1.LastSubmit is triggered on the display form, however because a new form is triggered by the Edit form, the display form is wiped so one can't see the last submitted record. 

 

How do I ensure that the last submitted record is visible in the display form? My ultimate aim is a user can fill out a form, hit submit, and three things happen: a) the record they just submitted goes to Sharepoint list as a new item b) the same record displays in the display form to show the user what has been submitted c) the form "remembers" their last inputs which can be tweaked and submitted as a new item.

 

Any thoughts/suggestions welcome! Thanks.

PA_05.PNG
PA_02.PNG
PA_04.PNG
Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @redturtle 

    First off, your OnSelect action of your button should ONLY be SubmitForm(Form1).  

    You should always avoid putting anything after the SubmitForm function as the function is not synchronous. It will immediately begin executing the statements after the SubmitForm while in the background the submitform function will begin happening.  So there is no chance that your LastSubmit will contain anything at that point.

     

    Everything you want to occur after the form is submitted should be in the OnSuccess action of the form.

     

    To do what you are trying to do, you need to avoid using a New form.  Your form should be in Edit mode always.

    In your OnSuccess action of the form, set the formula to the following:

    Set(glbLastRecord, Self.LastSubmit)

    Get rid of all the other set statements you have...it's just a lot of typing and work that you don't need.

    If you have altered your form in some way to account for all those variables, undo it - again, you don't need it and it is just more work to deal with.

     

    Set the Item property of your form to:

    Patch(Coalesce(glbLastRecord, Defaults(yourDataSource)), {ID: Blank()})

     

     This will all produce new records when submitted and your form will retain all of the last submitted data.

     

    I hope this is helpful for you.

  • redturtle Profile Picture
    41 on at

    Thanks @RandyHayes that worked perfectly. Appreciate you taking the time to support, as well as explaining the problem in detail. All the best, Rafael

     

     

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

    @redturtle 
    No problem at all.  Glad it was clear and helpful.

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

    @redturtle 

    Thank you for the Coffee!!  I do enjoy a good cup or ten of it 🙂

    Best wishes for the new year!

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard