web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Blank Gallery Entry fo...
Power Apps
Unanswered

Blank Gallery Entry for New Record

(0) ShareShare
ReportReport
Posted on by 439

Dear Power Apps Community,

 

I'm new to Power Apps and would appreciate your help. I have an app which has two galleries on a single screen. The data source for both galleries is the same SharePoint list.  The user selects a record in the first gallery ("Guest"), which populates the second gallery ("Guest Details"), whose default DisplayMode is Read. By clicking an icon, the DisplayMode changes to Edit, and the user can edit the fields; by clicking a Save icon the record is updated using Patch back to the source SharePoint list. This works as intended.

 

I need functionality to create a 'blank record' in the second Gallery ("Guest Details"), such that the same fields appear as if the user had chosen an existing record from Gallery 1, but whose fields are blank so the user can create a new record. In other words, I want "Guest Details" to show my text labels (like "First Name"), but next to each label there should be a blank cell for the user to enter the data. Upon saving the new, single record, this should Patch back to the SharePoint list such that it assigns the next [SharePoint List] ID in line when the new record is added.

 

In another part of the app, I've achieved this using a Collection - to add a new record, the user clicks a button to go to a new screen that has a separate Gallery, designed for data input. The user can click an 'Add to Collection' button to enter multiple new records, all of which are Patched when they click Save.

 

What I can't seem to determine is how to use a single Gallery both for displaying existing records and creating a single, new record, which is then Patched back to the SharePoint list, without the use of a Collection. I am trying to simplify my App design for a data entry screen that will be used rarely, so am trying to avoid a Collection, or setting a separate data entry screen with separate gallery.

 

Thank you very much for your time and expertise Power Apps community! If anything is unclear, please let me know and I will elaborate.

Many thanks, Edd

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @pp365 Galleries need a Datasource to display data. This could either be a datasource something like SP List or just a collection. The normal way to do what you intend to do would be with collections. But if you want to avoid collections, you can have an icon to add a new record. When the user clicks on this icon, you can add a blank record to the SP List, pre-select this record and let the user edit the details and save it.

  • pp365 Profile Picture
    439 on at

    Hi @CNT , many thanks for your fast reply. 

     

    "The normal way to do what you intend to do would be with collections".

     

    I'm not adverse to using a collection, but I don't understand how I can populate the collection without the user being able to see a blank Gallery, where they can be prompted for the required data and enter that data in to cells, so it can be added to the collection? 

     

    To expand if helpful: in this instance they would not select a record in the first gallery ("Guest") so the second gallery ("Guest Details") would not be populated with a record as no record is currently selected. Upon clicking a 'New' button, "Guest Details" should have a 'blank page' with just my prompt text labels and the data entry labels. Such a 'page' could then be appended to a collection, but how do I get to the stage - that using the same gallery for data read, that gallery can also be used for data entry?

     

    Even though I'm new to Power Apps I am trying to learn the optimum way to achieve these tasks as I go along. If you could expand on how I can leverage a Collection in this instance, I'd be really grateful. 

     

    Many thanks, Edd

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @pp365 I'd point you to an excellent video by Reza https://www.youtube.com/watch?v=8I0Pt_8I6k8

     

  • pp365 Profile Picture
    439 on at

    Many thanks @CNT . Will watch that momentarily and get back with an update.

    I have watched hours of Shane Young's excellent Power Apps videos which has taught me a vast amount, however, this is one concept I can't quite fathom at present. 

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @pp365 It is a bit tricky but give it a go. I have done it myself and if you need any help, just give me a buzz.

  • pp365 Profile Picture
    439 on at

    Hi @CNT ,

     

    I wanted to feedback your proposed solution of @RezaDorrani's excellent video solved my query (Power Apps Editable Table/Gallery like Excel (Tutorial) - YouTube). 

     

    For anyone reading the post in the future, the specific part that resolved the issue for me was the OnSelect action of a button (to create a new record in the Gallery and corresponding SharePoint list) required this:

     

    Patch('SharePointListName', Defaults('SharePointListName'), {MandatoryFieldRequiredUpdating:""})

     

    Also for completeness, don't forget to patch any data you add to the Gallery when you are finished adding data (again see Reza's great video on the options).

     

    Many thanks @CNT and @RezaDorrani and will mark solution as answered now. Best, Edd

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @pp365 Glad to help!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard