cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jaimeMtz07
Helper III
Helper III

update a column from a list of SPs with a column from the collection

Hi Team

I need update a column from a list of SPs with a column from the Collection.

 

My Collection has the following columns: 

Title, Description, Date, Qty, Stock, MovementType, Buyer

 

In my SP list has the following columns:

Title, Description, Quantity, QTYMAX

 

The Title column contains the same values in the Collection and SP List they can bi used for the LookUp formula if is needed.

 

I´m looking to Save/Update in the Quantity (SP List) column the value of the Stock (Collection) column with the OnSelect property of an icon. 

 

Thanks in advance.

Regards.

3 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @jaimeMtz07 ,

If you are looking to update all items from the collection, try this

Patch(
   SPList,
   ForAll(
      Collection As aPatch,
      With(
         {
            wID:
            LookUp(
               SPList,
               Title = aPatch.Title
            ).ID
         },
         {
            ID: wID,
            Quantity: aPatch.Stock
         }
      )
   )
)

 

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

jaimeMtz07
Helper III
Helper III

Hi @WarrenBelz  thanks a lot, works fine.

I just delete one ","

Patch(
   SPList,
   ForAll(
      Collection As aPatch,
      With(
         {
            wID:
            LookUp(
               SPList,
               Title = aPatch.Title
            ).ID
         },
         {
            ID: wID,
            Quantity: aPatch.Stock
         }
      )
   )
)

 

 

View solution in original post

Hi @jaimeMtz07 ,

Fixed in mine also - dangers of free-typing code in Notepad without the benefit of red lines.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @jaimeMtz07 ,

If you are looking to update all items from the collection, try this

Patch(
   SPList,
   ForAll(
      Collection As aPatch,
      With(
         {
            wID:
            LookUp(
               SPList,
               Title = aPatch.Title
            ).ID
         },
         {
            ID: wID,
            Quantity: aPatch.Stock
         }
      )
   )
)

 

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

jaimeMtz07
Helper III
Helper III

Hi @WarrenBelz  thanks a lot, works fine.

I just delete one ","

Patch(
   SPList,
   ForAll(
      Collection As aPatch,
      With(
         {
            wID:
            LookUp(
               SPList,
               Title = aPatch.Title
            ).ID
         },
         {
            ID: wID,
            Quantity: aPatch.Stock
         }
      )
   )
)

 

 

Hi @jaimeMtz07 ,

Fixed in mine also - dangers of free-typing code in Notepad without the benefit of red lines.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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