Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

How to Patch new Gallery Item/s with a blank ID to a Collection

(0) ShareShare
ReportReport
Posted on by 107

I have a collection from a sharepoint list. I also have a gallery with items from the collection so whenever I patched/add new item/s to the collection, it'll automatically reflect to the gallery adding new rows. How do I patched all the items in the gallery including the old ones to the Sharepoint list? I tried doing the one below but won't work because new items have blank col IDs. Still fairly new to PowerApps so any help or workaround is appreciated.

 

ForAll(
 RenameColumns(
 price_gal.AllItems,
 "ID",
 "IDD"
 ),
 Patch(
 MainList,
 LookUp(
 Filter(
 colPrice,
 'Item No.' = _Selected.'Item No.'
 ),
 ID = IDD
 ),{...}))

 

 

  • Re: How to Patch new Gallery Item/s with a blank ID to a Collection

    Hi @rzainm ,

     

    How is the situation? Have you solved your problem?

    If you find my answer helpful, you can accept it as a solution to help more people trapped in this problem.

     

    Best regards,

    Rimmon Li

  • Verified answer
    Re: How to Patch new Gallery Item/s with a blank ID to a Collection

    Hi @rzainm ,

     

    Do you want to patch all the items in the gallery including the old ones to the SharePoint list? In SP, the ID column is automatically generated and cannot be modified, I recommend that you set a column with no duplicate value to mark each record, such as the Title column. Maybe you can try this:

    ForAll(Gallery.AllItems As C, If(!isBlank(LookUp(List,Title=C.Title)),Patch(List,LookUp(List,Title=C.Title),C),Patch(List,Defaults(List),C)))

     

    Best regards,

    Rimmon Li

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

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard