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 / Patching a single colu...
Power Apps
Unanswered

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,628 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard