web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Edit a single row in c...
Power Apps
Suggested Answer

Edit a single row in collection in Gallery

(1) ShareShare
ReportReport
Posted on by 531
Hi,
 
I have a gallery with 3 rows. I need to allow editing of individual rows in gallery which is working fine. I am able to save the data successfully as well. 
 
Can please let me know on how to make the display mode as read only once the particular row is saved?  
 
 
Add button OnSelect
 
Collect(
    yourCollection,
    {
        Name: "",
        Email: "",
        Designation: "",
        Contact: "",
        RandID:Rand()
    }
)
 
Add button Displaymode (to allow only 3 rows to be added)
 
If(
    CountRows(yourCollection) < 3,
    DisplayMode.Edit,
    DisplayMode.View
)
 
Gallery Items property
yourCollection
Gallery Edit icon
UpdateContext({varEditItem: ThisItem})
Displaymode of TextInput in Gallery
If(
    ThisItem.RandID = varEditItem.RandID,
    DisplayMode.Edit,
    DisplayMode.View
)
 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    I suspect that setting varEditItem to zero will do the job. You should also do this at Screen OnVisible to initiate the variable as numeric as Blank() can be a number of possible formats.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • Suggested answer
    Sivaksk147 Profile Picture
    10 on at
    did you try this option ?
     
    If(ThisItem.IsSelected, DisplayMode.Edit, DisplayMode.View)
     
  • Suggested answer
    jpespena Profile Picture
    335 on at
     
    Add this at the end of the Save and Delete button functions to make the local variable blank:
    UpdateContext({varEditItem: Blank()})
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard