cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
modernoddity
Level: Powered On

Allow Users to Edit Collection Entries

I'm working on an expense report app that allows users to enter their expense information, click a button that records it to a collection and displays it in a data table at the bottom of the app, and when they're done entering all their information they hit the submit button and it pushes all the data from the collection to our SQL database and wipes the Collection. I would like the user to be able to edit/delete records they've entered in the collection prior to submitting (if they need to) but haven't been able to figure out how to do this. What is the best way to accomplish this or is it even possible? 

 

Thank you! 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Allow Users to Edit Collection Entries

@modernoddity 

There are quite a few steps to go about doing this.

I would recommend that you watch the amazing two part series video from Shane Young on this very topic. 

Part one is here - https://www.youtube.com/watch?v=xgznk4XlPCo

Part two is here - https://www.youtube.com/watch?v=DylxsXIUyDc

 

If you get stuck on any particular areas, just post back.

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Allow Users to Edit Collection Entries

@modernoddity 

There are quite a few steps to go about doing this.

I would recommend that you watch the amazing two part series video from Shane Young on this very topic. 

Part one is here - https://www.youtube.com/watch?v=xgznk4XlPCo

Part two is here - https://www.youtube.com/watch?v=DylxsXIUyDc

 

If you get stuck on any particular areas, just post back.

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

K-A-R-L
Level 10

Re: Allow Users to Edit Collection Entries

Hi @modernoddity ,

 

It sounds like Update() or UpdateIf() may be what you're looking for.

Visit this: https://powerapps.microsoft.com/en-us/tutorials/function-update-updateif/

 

See how it goes and keep me posted.

 

Cheers

Community Support Team
Community Support Team

Re: Allow Users to Edit Collection Entries

Hi @modernoddity ,

Do you want to edit or delete the records entered in the Collection before submitting collection to your SQL Table?

 

If you want to edit or delete the records entered in the Collection before submitting collection to your SQL Table, I think the Gallery control could achieve your needs, please take a try with the following workaround:12.JPG

 

13.JPG

 

14.JPG

 

15.JPG

On your side, you could consider add a Gallery control within your app instead of the Data Table control to preview the Collection data. Then within the Gallery, add some TextInput controls, set the Default property of the TextInput boxes to following:

ThisItem.ColumnName

using above formula to display the column value of each record of your Collection.

Set the OnSelect property of the "Edit" icon button to following:

Patch(
RecordsCollection,
Defaults(RecordsCollection),
{
ProductName: TextInput1.Text,
Price: Value(TextInput2.Text),
ProductionDate: TextInput3.Text
}
)

On your side, you should type:

Patch(
       YourCollection, 
       Defaults(YourCollection),
       {
         Column1: TextInput1.Text, 
         Column2: Value(TextInput2.Text), 
         Column3: TextInput3.Text,
... } )

Set the OnSelect property of the "Remove"icon button to following:

Remove(RecordsCollection,ThisItem)

On your side, you should type:

Remove(YourCollection,ThisItem)

Please check the following attached sample app for more details:

 

Please also check and see if the following video would help in your scenario:

https://www.youtube.com/watch?v=41Mpgn7svLs

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
modernoddity
Level: Powered On

Re: Allow Users to Edit Collection Entries

@RandyHayes , I LOVE Shane Young's videos... they've been incredibly helpful to me as I get used to using PowerApps. Thank you for the links, I will check them out shortly! 

modernoddity
Level: Powered On

Re: Allow Users to Edit Collection Entries

@v-xida-msft thank you so much! I will give this a try shortly and see how it goes! Really appreciate the help Smiley Happy 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 331 members 1,880 guests
Please welcome our newest community members: