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.
Solved! Go to Solution.
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!
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
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!
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
Thanks
I have similar situation but my columns have dropdown. how I should patch in this case?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
205 | |
70 | |
49 | |
49 | |
20 |
User | Count |
---|---|
252 | |
124 | |
84 | |
76 | |
73 |