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 new row to gallery
Power Apps
Answered

add new row to gallery

(0) ShareShare
ReportReport
Posted on by 31

Hi,

 

I have gallery: items

with columns: number, description, qty

 

how can I add new row (when button presses) to this gallery with:

number=111

description=niceitem

qty=10

 

Thanks.

Categories:
I have the same question (0)
  • Verified answer
    Edwin-Abdalian Profile Picture
    641 on at

    you need to use the Patch function on the OnSelect of your button. The Patch function will actually add a row to your Data Source.

     

    Patch('YourDataSourceName', Defaults('YourDataSourceName'), { number:111 , description: "niceitem" , qty:10})

    --------------------------------------------------

    Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

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

    Hi @Pablo2 ,

     

    If you are new to PowerApps and you are trying to manage records from SharePoint list, please try to start with creating an auto-generated app. Select Home > Start from data > Create > SharePoint(Phone Layout) > fill you SharePoint site URL, select the listed List name, PowerApps will automantically create an app for you. If this app, you will see that normally we use an edit form to edit an existing item or create a new item. Gallery is for showing all the records from data source.

     

    But if you do not want to use Form control to add new items, and you want to add one directly with the data:

    number=111

    description=niceitem

    qty=10

    I assume that all these fields are text/number column. Then you can a button control and set its OnSelect property to the formula that @Pablo2  suggested.

     

    Regards,

    Mona

     

     

     

  • Verified answer
    Rozpalacz Profile Picture
    31 on at

    Thanks

  • Quality2 Profile Picture
    33 on at

    I have similar situation but my columns have dropdown. how I should patch in this case? 

     

  • Jagadeesh21 Profile Picture
    21 on at

    Hii @Edwin-Abdalian  my data source is a collection , its showing an error , when i  use my collection as a data source , how can i resolve it ????

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard