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 / Patch multiple columns...
Power Apps
Unanswered

Patch multiple columns from a gallery into a SharePoint list row.

(0) ShareShare
ReportReport
Posted on by 901

Happy Wednesday! Power Apps Community.

 

Trying to figure out how to patch the rest of the columns from a gallery into the SharePoint list.

 

oappdev_0-1645026422769.png

 

oappdev_0-1645026891369.png

 

 

 

I hope I explained myself clearly. Thank you in advance.

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @oappdev 

    Your formula will only reference one row of your Gallery.  Is it that you are trying to use all rows from the gallery?  Can you explain a little further what you are attempting?

  • oappdev Profile Picture
    901 on at

    Hi @RandyHayes , absolutely. What I am trying to accomplish is to patch the rest of the gallery selection to a row with multiple columns. For example.

     

    If the user selects the following (radio and added a comment) it will patch to the following column.

    DMEYesAdded a comment
    Functional AssessmentNoAdded comment
    Cognitive StatusYesAdded a comment

     

    Is this the right formula?

     

     

    ForAll(
     colAuditForm,
     Patch(
     ChartAuditForm,
     Defaults(ChartAuditForm),
     frmAudit.Updates,
     {
     Element:Element,
     'Y/N':Y_x002f_N,
     Comments:Comments,
     ElementDME: ElementDME,
     'ElementDMEY/N': ElementDMEY_x002f_N,
     ElementDMEComment: ElementDMEComment
     }
     )
    )

     

     

     

    I created a collection for my SharePoint List.

     

     

    ClearCollect(colChartAuditForm,ChartAuditForm)

     

     

     

    Then created another collection just to show the columns i needed.

     

     

    ClearCollect(colAuditForm,ShowColumns(colChartAuditForm,"PCP","Center","Patient","Category","Element","Y_x002f_N","Comments","ElementDME","ElementDMEY_x002f_N","ElementDMEComment"))

     

     

    SharePoint List

    oappdev_0-1645033228733.png

     

    Power Apps Form

    oappdev_1-1645033252475.png

     

     

     

    What am I doing wrong or missing?

     

    Thank you again for your help.

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @oappdev 

    Well, to start, the formula with the ForAll is backward, but we'll get to that next.

     

    For clarity - Is this part of your screen a Gallery or separate items?

    RandyHayes_0-1645036485211.png

     

  • oappdev Profile Picture
    901 on at

    I am having one of those days. Yes, it's part of my screen. with the following controls.

     

    labelRadio controlText Input control
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @oappdev 

    So then you are stating that it is NOT a gallery!

     

    Out of curiosity, is the part above that a Form?  If so, then this should all be done with the Form itself to submit your values and not with a Patch.

    You should have ALL of the fields that you want to write included in your Form.  They do NOT need to be visible, but they need to be part of the Form.

    Then in the Update property for the field you want to write, just reference the control in your lower part of the screen.

    So, for example, the ElementDMEComment field, the Update property would reference your TextInput control - ex: 

    ElementDMEComment.Text

     

    There is no need for any collections or other patching.  It will all then be submitted when you issue a SubmitForm(frmAudit)

  • oappdev Profile Picture
    901 on at

    So sorry to confuse you, Randy. It's 1 form and 1 gallery on the same screen. For each element (DME, Cognitive Status, etc), they want to have a comment section with a (Yes/No/N/A/Other) radio button control. Let me know if you still need some clarification.

     

    I already built out a SharePoint site with those columns.

     

    frmAudit

    oappdev_0-1645041647119.png

     

    galChartAudit

    oappdev_1-1645041703340.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @oappdev 

    No problem.  Just trying to get a handle on what you have going on.

     

    Yes, you will still want to just submit this all with the form.  

     

    What is the Items property of the Gallery? And, (pre-guessing), do all of the rows in that gallery correspond to columns in the SharePoint list?  And, what type of columns do they correspond to - text, choice, etc?

  • oappdev Profile Picture
    901 on at

    @RandyHayes 

     

    The Items property of the gallery is the data source for the SharePoint List (Chart Audit). On the first screen, I just added the 4 questions to the form, and then added the gallery with the rest of the columns from SP List (Chart Audit). The type of columns is type (single line of text), except the score column is a type (Number).

     

    If it was just a form, I would have just used Submit Form () and put one in the record book. 😁

     

    Thank you for your patience and help.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @oappdev 

    <Confusion sets in...>

    So, you have a Form that is based on Chart Audit and a Gallery that is based on Chart Audit as well?  I don't think that is what you have, so can you explain that a little more?

     

    Ultimately (to provide some clues), the goal is to get to a point that you are looking up the value from the gallery to provide for the Update property of the field/column in the form.  But, I am trying to understand the relationship.

    For example, if we stick with DME, my assumption (because you are using the Chart Audit list as your Gallery source) that there is a RECORD in the list that have "DME" in it, perhaps in the Title column.  

    So, this would then not be the source of the form...my guess is that you have a different list for the Form and there is a COLUMN in the other list that is DME.

     

    Am I batting in the right ballpark?

  • oappdev Profile Picture
    901 on at

    You hit a homerun. My apology. So, the data source of the form is SharePoint List (Chart Audit) and the data source for the gallery is SharePoint (Audit Questions). What I am trying is to patch both the form data source and the gallery data source into the SharePoint Master List (Chart Audit Form). (Long day) Going to buy some 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

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