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 / Create record and dyna...
Power Apps
Answered

Create record and dynamically update gallery as data is entered in a new form

(0) ShareShare
ReportReport
Posted on by 18

Hello all.  I could really use help on this, since this may be the last piece I need before sharing the app with my coworkers.

 

I need to create a new record in my SP list prior to saving a new form and I need the gallery to show, not only what people have entered and saved in a completed form, but also what they're currently entering in a new form.  I don't necessarily need each field to appear in the gallery as data is entered, but I need the first few fields to show, which includes 'Type of Sweep', 'Plaza', 'Employee', and 'Start Time'.  The remaining fields can be added to the gallery when the individual saves the completed form.  I have no clue what to do here.

 

Also not sure what I'm doing wrong but my date/time fields aren't resetting with a new form.

 

Gallery.PNG

New Form.PNG

 

 

 

Categories:
I have the same question (0)
  • Joel CustomerEffective Profile Picture
    3,224 on at

    that's not going to work---data entered on a new form is not saved until the form is submitted, so you aren't going to see it in your gallery until the record is created.

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @kdunk ,

    Do you want to display not only the submitted data but also the entering data in the gallery?

    Please notice that: if you set the gallery's Items to one table , it will only display the items existing in that table.

    The item that has not submitted does not exists in the table. So the gallery could not display that kind of data.

     

    However, here's an alternative solution:

    make the gallery display a collection, not the data source directly

    when you are typing data in the new item, you will update that collection

    when you submit the new form, you will update your data source

     

    I've made a similar test for your reference:

    1)set the app's OnStart:

    ClearCollect(collection1,datasourcename)

    2)set the gallery's Items:

    collection1

    3)set the add item button's OnSelect:

    NewForm(formname);
    ResetForm(formname);
    Patch(collection1,Defaults(collection1),{'Type of Sweep':""})
    //create a new item in the collection

    4)set the new form's data source:

    datasourcename

    4)set 'Type of Sweep' drop down's OnChange:

    Patch(collectoion1,Last(collection1),{'Type of Sweep' :'Type of Sweep'datacardname.Update})

    set 'Plaza' drop down's OnChange:

     

    Patch(collectoion1,Last(collection1),{'Plaza' :'Plaza'datacardname.Update})

     

    set 'Employee' drop down's OnChange:

     

    Patch(collectoion1,Last(collection1),{'Employee' :'Employee'datacardname.Update})

     

    set 'Start Time' drop down's OnChange:

     

    Patch(collectoion1,Last(collection1),{'Start Time' :'Start Time'datacardname.Update})

     

    //update the last record in the collection

    4)set the submit button's OnSelect:

    SubmitForm(Formname);ClearCollect(collection1,datasourcename)

     

     

    5)set the cancel button's OnSelect:

    Remove(collection1,Last(collection1))
    //delete the record that you create

     

    Then when you open the new form, you will create an item in the collection. When you enter data in the new form, you will update data in the collection. When you submit the form, you will submit the form, you will save data to your data source and update the collection.

     

     

    Best regards,

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard