cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
modernoddity
Helper III
Helper III

Edit only selected item in Gallery

I am displaying data from a collection within a gallery and have set it up so users can edit, save, or delete records. However, I cannot seem to figure out how to get it so that ONLY the line item selected is changed to edit mode while the other records stay as view only. Right now when I select the edit button, all items become editable. 

 

 

18 REPLIES 18

@RandyHayes the EditMode column is in the collection, however when I tried the label test here is the result I got: 

 

1.png

@modernoddity 

 

yourGalleryName.Selected.EditMode

 

Not the name of your collection

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes thank you! Multitasking... I read too quickly lol. 

 

Changed it to the gallery name and it remained "false" regardless of what I did. 

@modernoddity 

Okay, then something is wrong with the patch statement or before.  Since we verified that the Patch statement is correct, let's look before...

Where are you defining the collection for the ExpenseCollection? and, let's see that formula in it's entirety.  From the little snip you sent, it looked correct, but need to see it in its native habitat (i.e. the whole formula)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @modernoddity 

 

I have seen that sometimes patch isn't able to update the collection that we imported from a SharePoint list, so you can use UpdateIf to update the collection.

Thanks for the input @DavesTechTips.  Yes, Patch does have an issue with collections from SharePoint, but only with columns that have empty values.  That's always something to consider when there are issues.

What @modernoddity is doing in this case should work, but (@modernoddity) need to see that collection formula.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes here is the complete code in the OnSelect property of the "Record Expense" button: 

 

Collect(ExpenseCollection, {ReportDate: Date_ReportDate.SelectedDate, Date: ExpenseDate.SelectedDate,User: L_CurrentUser.Text, Region: DD_Region.SelectedText.Value, Amount:T_Amount.Text, Expense_Description: DD_ExpenseDesc.SelectedText.Value,PersonEntertained:T_PersonEnt.Text,CompanyEntertained:T_CompanyEnt.Text, PlaceEntertained:T_PlaceEnt.Text, JobCostCode: DD_JobCostCode.SelectedText.Value, ChargeToState: DD_ChargeState.SelectedText.Value, Distributor: DD_Distributor.SelectedText.Value, CustomerCode: DD_CustomerCode.SelectedText.Value,ContractNumber: DD_ContractNo.SelectedText.Value,Notes: T_Notes.Text, EditMode: false});Reset(ExpenseDate);Reset(T_Amount);Reset(DD_ExpenseDesc);Reset(DD_ChargeState);Reset(DD_Distributor);Reset(T_Notes);Reset(T_PersonEnt);Reset(T_CompanyEnt);Reset(T_PlaceEnt); UpdateContext({Needtosave:false})

@RandyHayes So..... inexplicably.... today I logged in and started working on it again and it's working. I didn't change anything since last night so I'm not sure why it's working today but it wasn't yesterday. But thank you so much for your help! 

@modernoddity 

Ah yes...been there before!  Sometimes the designer gets confused and only an exit and go back in will clear it up.

Glad you got through it...on to the next!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,386)