Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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 🙂

 

  • Rob_CTL Profile Picture
    on at
    Re: Patching a single column on all items in a gallery (choice column) with the same value

    @developerAJ 

     

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

  • Verified answer
    developerAJ Profile Picture
    2,855 on at
    Re: Patching a single column on all items in a gallery (choice column) with the same value
    ForAll(gal_invoicing_hours.AllItems,
    Patch(Invoices, ThisRecord,
    {
     Invoiced: { Value: "Yes"}
    }
    )

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard