Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Patch Multiple Rows based on condition

(0) ShareShare
ReportReport
Posted on by 178

Hi Guys,

 

I would like to patch multiple rows at once.

 

Example Colour column values "blue, red, brown" patch column available as "Yes".

At the moment I'm doing this in 3 separate patch formulas.

 

Unsure if this is possible.

 

Any help is greatly appreciated.

 

Thanks

  • EddieE Profile Picture
    EddieE 4,641 on at
    Re: Patch Multiple Rows based on condition

    @christian12 

    Without any code or app context this is a little hard to provide a specific solution.

     

    However, assuming you have a number of checkboxes with colour names, they could be setup like so

    // OnCheck property, assumes the Text properties are set to colour names eg 'Red', 'Brown' etc
    Collect( colCheckedColours, Self.Text)
    
    // OnUncheck property
    RemoveIf( colCheckedColours, Value = Self.Text)

     

    Then a button to update your records, using UpdateIf()

    UpdateIf(
     yourTableName,
     Colour in colCheckedColours.Value,
     {Available: "Yes"}
    )

     

     

  • christian12 Profile Picture
    christian12 178 on at
    Re: Patch Multiple Rows based on condition

    Thanks @EddieE 

     

    This will only work if all ID's are the same. In this case I only need to patch say "blue,green and red". 

     

    There are 10 different colours within the collection and nothing available that ties these colours together.

  • EddieE Profile Picture
    EddieE 4,641 on at
    Re: Patch Multiple Rows based on condition

    @christian12 

    Assuming you have your Colour data in say a collection, you can use a Patch( ForAll()), eg

    Patch(
     yourTableName,
     ForAll(
     yourColourTbl,
     {
     ID: ID,
     Colour: "Yes"
     }
     )
    )

     

    Note: the ID is needed in the above code because the functions needs something to reference to work properly. If you don't have ID, you'll need some other reference field

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard