Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Edit a single row in collection in Gallery

Posted on by 490
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:
  • Suggested answer
    jpespena Profile Picture
    jpespena 294 on at
    Edit a single row in collection in Gallery
     
    Add this at the end of the Save and Delete button functions to make the local variable blank:
    UpdateContext({varEditItem: Blank()})
     
  • Suggested answer
    Sivaksk147 Profile Picture
    Sivaksk147 10 on at
    Edit a single row in collection in Gallery
    did you try this option ?
     
    If(ThisItem.IsSelected, DisplayMode.Edit, DisplayMode.View)
     
  • WarrenBelz Profile Picture
    WarrenBelz 143,591 on at
    Edit a single row in collection in Gallery
    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

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard