cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

add new row to gallery

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.

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Solution Supplier
Solution Supplier

Re: add new row to gallery

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!

View solution in original post

Highlighted
Community Support
Community Support

Re: add new row to gallery

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

 

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: add new row to gallery

3 REPLIES 3
Highlighted
Solution Supplier
Solution Supplier

Re: add new row to gallery

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!

View solution in original post

Highlighted
Community Support
Community Support

Re: add new row to gallery

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

 

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: add new row to gallery

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,082)