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 / Add a row into the Gal...
Power Apps
Suggested Answer

Add a row into the Gallery in newform on click of a button

(1) ShareShare
ReportReport
Posted on by 593
I have a powerapp gallery with Sharepoint as the datasource. At max, user can add only upto 4 rows in the gallery. There should be a edit button in gallery where user can edit the record and save back to sharepoint. Screenshot below. 
 
 
Items property of the form is empty as its the newform.
 
 
Items property of the gallery is datasource name 'Roles'
 
 
Add button code
Patch(
    Roles,
    Defaults(Roles),
    {
        Title: "",
        'Email': "",
        'Designation': "",
        'Phone': ""
    }
);
Refresh('Roles')
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Hi
     
    I am super confused.
     
    Your Subject and your ask is to do something to add a new row.
     
    But you wrote this
    I have a powerapp gallery with Sharepoint as the datasource. At max, user can add only upto 4 rows in the gallery. There should be a edit button in gallery where user can edit the record and save back to sharepoint. Screenshot below.
     
    So I have no idea what you are asking. Create new, Edit existing, no idea.
     
    That being said your code to add a new one looks fine.
     
    So again, what are you asking for, what problem do you have, what errors etc?
     
  • Suggested answer
    CamiloLuque Profile Picture
    228 on at
    Hi. I tested something like the below:
    1. In the edit button you can save in a variable the ID of the record that you want to edit.
    2. The DisplayMode property of the text boxes has a condition to enable or disable it.
    3. In the save button you can use Patch function to save the record data in the SharePoint list.
    4. Optional. One button to eliminate the record.
    5. You can establish a condition of the DisplayMode property of the New form and Submit form buttons. When the gallery has 4 records, disable the buttons.
    See the pics:
     
    1
     
    2
     
    3
     
    4
     
    5
     

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 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard