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 and save only sel...
Power Apps
Unanswered

Edit and save only selected item in Gallery

(0) ShareShare
ReportReport
Posted on by 146

Hello,

I have a Gallery "GalleryAssignment" which displayed the information stored in a SharePoint List "Assignment". Inside the Gallery I have manually include Labels, Drop Downs and Date Picker which are connected to the SharePoint list. The user can select an assignment within the Gallery and edit and save the information.

        -The edit button appears by default on every row in the Gallery and when it is selected, a Save button is displayed (it is invisible until the edit button is selected).

       -The information within the Gallery (Labels, Drop Downs and Date Picker) initially is shown as View Mode, and when the edit button is selected, the Display-Mode turn to Edit.

I have not been able to achieve that  only the line item selected to be edited in the Gallery is changed to Edit Mode (DisplayMode. Edit) while the other records still shown as View Mode.

 

Any suggestion is much appreciated!

Categories:
I have the same question (0)
  • Verified answer
    eka24 Profile Picture
    20,923 on at
    Chris Clark did a good job on patching only edited item whiles others remain view mode. Hope it helps
    https://youtu.be/41Mpgn7svLs
  • vsolanon Profile Picture
    146 on at

    Hi @eka24 thank you for the workaround, it worked as a charm!

     

    My only question now will be, how I can make invisible/disable the others Edit buttons from the Gallery when a line record of the Gallery is being edited?

     

    I have test the solution and noticed when I select to edit one line item and update the information without saving, and then select another line item to be edited, the information updated in the first line item is still shown, however this will not be saved in the system until the user select the Save button. Want to make the application the more clean possible in order for the user to not get confuse and think the information will be updated all at once.

     

    Thank you!

  • eka24 Profile Picture
    20,923 on at
    Good the first main issue is resolved. Be a little more clearer on the new request.

    If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution
  • vsolanon Profile Picture
    146 on at

    @eka24 I would like that when the user is editing a selected item in the Gallery, the other Edit Buttons disappear.

     

     

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @vsolanon 

     

    I made a demo app, please check the following steps.

    1. modify the Items property of Gallery, add two columns to store EditMode and ViewMode to each row

     

    AddColumns('SP list',"EditMode",DisplayMode.Edit,"ViewMode",DisplayMode.View)

     

    2. modify the OnSelect property of Edit button.

     

    Set(varEditMode,ThisItem.ID)

     

    3. set DisplayMode property of TextInput box, dropdown box, and date picker, when the edit button is clicked, the control turns Edit Model

     

    If(varEditMode=ThisItem.ID,ThisItem.EditMode,ThisItem.ViewMode)

     

    4. set OnSelect property of Save button: 

    Set(varEditMode,-1)

    5. set Visible property of Save button, when the edit button is clicked, the save button turn visible

     

    If(varEditMode=ThisItem.ID,true,false)

     

    6. To the new request, set DisplayMode of Edit button, when one edit button is clicked, set other Edit button to be disabled.

    If(ThisItem.ID=varEditMode||varEditMode=-1||varEditMode=Blank(),DisplayMode.Edit,DisplayMode.Disabled)

    Result:

    GIF_36.gif

    Sik

     

                                                                                                                             

  • eka24 Profile Picture
    20,923 on at
    If you are to follow strictly Chris approach, then the work around would be giving the selected item background on the gallery, a different color from the others.
    Also try changing the UpdateContext from view to disabled an see the effect.
    By the way, the other edit is view only.
  • vsolanon Profile Picture
    146 on at

    Hi @v-siky-msft Thank you very much for the information! It worked 🙂

     

    Would it be possible when the user select the Edit button of one item in the Gallery, cannot select another item in the gallery if the Edit button is still active?

     

    I noticed with the solution proposed, the user cannot Edit the value of the other items in the Gallery, however is able to select them.

    I am asking this because I have a second Gallery in the screen and I filter this second Gallery based in the selected item from the first Gallery (Gallery.selected). It is not working as expected, (please see image attached for reference-I have add a label test, and noticed even though the Edit item selected is the first in the Gallery, the yellow label brings the ID for the second item, since the user select it)

    PowerApp Question3.JPG

    Thank you in advance!

  • v-siky-msft Profile Picture
    on at

    Hi @vsolanon 

     

    Yes, I got you.

    Please go to set the Selectable property of Gallery as follows, then when one row is being edited, the gallery cannot be selected.

    If(varEditMode=-1 || varEditMode=Blank(), true,false)

    GIF_37.gif

    Hope this helps.

    Sik

     

    Please click Accept as solution if my post helped you solve your issue.

     

  • vsolanon Profile Picture
    146 on at

     

    @v-siky-msft  Thank you very much!! this was exactly was I was looking for 🙂

  • AbhijithSh Profile Picture
    3 on at

    I followed this and worked like a charm. Thanks very much, opened my eyes for more such concepts.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard