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 a single colu...
Power Apps
Answered

Patching a single column on all items in a gallery (choice column) with the same value

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am building out an invoicing app, most the app is now built but I've got stuck on one part.  The app is using a SharePoint list as its data source.  This list contains the items that are added to the invoice, the two key columns in the list are:

 

CustomerRef - This is a unique identifier for the customer

Invoiced - This is set to "Yes", "No" or "n/a", this is a choice column.  This shows the if the items has been invoiced.

 

Invoices are run once a week, in the app you select the customer which then populates a gallery with all the items that are due to be invoiced.  The gallery has a filter that uses the "Invoiced" column to ensure that only items that haven't been invoiced yet are shown.  I have a button that then goes off and produces a PDF invoice that is sent to the customer. 

 

The bit I am getting stuck on is that I need to update all the items in the gallery and change the "Invoiced" field to "Yes".  I've tried a few combinations of using the ForAll commands but either nothing happens or I get an error.  I presume the fact that the column I am updating is a Choice column could be adding to my pain here.

 

Example formula's I've tried:

 

ForAll(gal_invoicing_hours.AllItems,
Patch(Invoices, ThisRecord,
{
 Invoiced: "Yes"
}
)

 

If I try and wrap it in a collection I get a message that the "Invoiced" column doesn't exist

 

Collect(Invoices,
 ForAll(gal_invoicing_hours.AllItems,
 {
 Invoiced:"Yes"
 }
 )
)

 

I know I am doing something wrong, please show me the light 🙂

 

Categories:
I have the same question (0)
  • Verified answer
    developerAJ Profile Picture
    4,763 on at
    ForAll(gal_invoicing_hours.AllItems,
    Patch(Invoices, ThisRecord,
    {
     Invoiced: { Value: "Yes"}
    }
    )

     

     

  • Rob_CTL Profile Picture
    on at

    @developerAJ 

     

    I was so close 🙂  thanks for the guidance, I'll sleep easy again tonight!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 993

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 545

Last 30 days Overall leaderboard