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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching from Gallery ...
Power Apps
Answered

Patching from Gallery to List -- only updating the first row/record

(0) ShareShare
ReportReport
Posted on by 5

Using SharePoint List titled, "Site_Planned_Metrics" -- I have created a Gallery that returns the SharePoint list based on the userid. There may be instances where the user would fill out multiple rows. Unfortunately, when selecting the update icon (check mark), it removes all values from the gallery and updates only the row data where the icon is present. In affect, user could enter data for 3 rows, click on the icon, and only one row would be updated.

1) Ideally, I would like to see information remain in the gallery and not be cleared -- just indicate to user that record has been updated.

2) Ideally, I would like to see user to view the icon only if updates are being initiated AND selecting that ICON in that row only updates THAT row.

I'm new so go easy on me 🙂

 
 

Using the following code: 

Patch(Site_Planned_Metrics,ThisItem,{SAFETY: txtSAFETY.Text}, {PEOPLE:txtPEOPLE.Text},{QUALITY:txtQUALITY.Text}, {DELIVERY:txtDELIVERY.Text},{COST:txtCOST.Text})

Site_Planned_Metrics.JPGScreenCapture.JPG

Capture.JPG
Site_Planned_Metrics.JPG
Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Kenneth1 ,

    Do you add a "Check mark" icon within your Gallery?

    Do you also want to submit multiple rows back to your SP list at same time with one button click?

    Further, could you please share more details about the formula typed within the Items property of the Gallery?

     

    Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

    Set the Items property of the Gallery to following:

    Site_Planned_Metrics

    Within the Gallery, set the Default property of the SAFETY Text Box to following:

    ThisItem.SAFETY

    set the Default property of the PEOPLE Text Box to following:

    ThisItem.PEOPLE

    set the Default property of the QUALITY Text Box to following:

    ThisItem.QUALITY

    set the Default property of the DELIVERY Text Box to following:

    ThisItem.DELIVERY

    set the Default property of the COST Text Box to following:

    ThisItem.COST

     

    Set the Visible property of the "Check mark" icon to following:

    If(
     txtSAFETY.Text <> ThisItem.SAFETY || txtPEOPLE.Text <> ThisItem.PEOPLE || txtQUALITY.Text <> ThisItem.QUALITY || txtDELIVERY.Text <> ThisItem.DELIVERY || txtCOST.Text <> ThisItem.COST,
     true,
     false
    )

    Set the OnSelect property of the "Check mark" icon to following:

    Patch(
     Site_Planned_Metrics,
     ThisItem,
     {
     SAFETY: txtSAFETY.Text,
     PEOPLE: txtPEOPLE.Text,
     QUALITY: txtQUALITY.Text,
     DELIVERY: txtDELIVERY.Text,
     COST: txtCOST.Text
     }
    );
    If( // Show up a message when you update record successfully
     IsEmpty(Errors(Site_Planned_Metrics)),
     Notify("Updated Successfully!", NotificationType.Success),
     Notify("Updated Fail!", NotificationType.Error)
    )

     

    In addition, if you also want to submit multiple rows at the same time with a single button, please consider take a try with the following workaround:

    Add a button outside the Gallery, called "Submit". Set the OnSelect property of the "Submit" button to following:

    ForAll(
     RenameColumns(Gallery1.AllItems, "ID", "ID1"),
     Patch(
     Site_Planned_Metrics,
     LookUp(Site_Planned_Metrics, ID = ID1),
     {
     SAFETY: txtSAFETY.Text,
     PEOPLE: txtPEOPLE.Text,
     QUALITY: txtQUALITY.Text,
     DELIVERY: txtDELIVERY.Text,
     COST: txtCOST.Text
     }
     ) 
    );
    If( // Show up a message when you update record successfully
     IsEmpty(Errors(Site_Planned_Metrics)),
     Notify("Updated Successfully!", NotificationType.Success),
     Notify("Updated Fail!", NotificationType.Error)
    )

    Please consider take a try with above solution, then check if the issue is solved.

     

    More details about the ForAll function in PowerApps, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall

     

    Best regards,

  • Kenneth1 Profile Picture
    5 on at

    Although my timing to respond back to this thread was slow -- your responsiveness to addressing my issue was outstanding. Thank you for shortening my learning curve for this awesome application!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard