cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rhk
Helper I
Helper I

How to patch new value for particular column in share point by comparing other column value

 

 

Patch(
   List_name,
   LookUp(
        List_name,
        vehicle type = cars
),
{
 No_of_tyres : Text("4")
}
)

 

 

I have 2 columns in a SharePoint list vehicle and no_of_tyres

The code is only patching for the first item in the list and leaving other values. What should I need to do to patch the value = 4 to all vehicle types = car

Vehicle typeNo of tires 
car4
cycle2
car 
car 
cycle 

 

Thanks in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Rhk ,

Two options (also assuming here No of Tires is a Text column)

UpdateIf(
   List_name,
   'Vehicle Type' = "cars",
   {No_of_tyres : "4"}
)

or with a Patch

With(
   {
      wCars:
      Filter(
         List_name,
         'Vehicle Type' = "cars"
      )
   },
   Patch(
      List_name,
	  ForAll(
         wCars As aCars,
		 {
            ID:aCars.ID,		 
            No_of_tyres: "4"
         }
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

4 REPLIES 4
Rhk
Helper I
Helper I

@WarrenBelz Can you help with this?

Nordis
Frequent Visitor
Irfan
Resolver II
Resolver II

Hi @Rhk ,

Two options (also assuming here No of Tires is a Text column)

UpdateIf(
   List_name,
   'Vehicle Type' = "cars",
   {No_of_tyres : "4"}
)

or with a Patch

With(
   {
      wCars:
      Filter(
         List_name,
         'Vehicle Type' = "cars"
      )
   },
   Patch(
      List_name,
	  ForAll(
         wCars As aCars,
		 {
            ID:aCars.ID,		 
            No_of_tyres: "4"
         }
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,502)