web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : rXNUzTUij3/KJb1pghRLWL
Power Apps - Building Power Apps
Answered

Patch all items in gallery with text from text input outside gallery

Like (0) ShareShare
ReportReport
Posted on 12 Jun 2024 11:44:53 by 19

Hi all,

I have a gallery that can have several items in it, the items come from a collection. When I patch the gallery to a SharePoint list (Consumable Transactions) I would like to add a comment to each of the items patched to the SharePoint List. The comment will be the same comment for each item in the gallery and the comment will come from a text input outside the gallery (txtComment).

 

What I currently have is working fine, but how do I add the comment to each record using the txtComment input.

I have included my current code below, just need to add the outstanding bit if anyone can help please.

ForAll(
 galBasket.AllItems,
 Patch(
 'Consumable Transactions',
 //Defaults('Consumable Transactions'),
 {
 Title: ThisRecord.Title,
 Qty: Value(ThisRecord.Qty),
 Transaction_ID: (ThisRecord.Transaction)
 }
 );
 Patch(
 'Consumable Tools',
 LookUp(
 'Consumable Tools',
 ThisRecord.ID = Transaction
 ),
 {'In Stock': InStock - Value(Qty)}
 );
 
);
Clear(colBasket);
Notify (
 "Update Successful",
 NotificationType.Success,
 5000
)

 

Thanks In Advance

  • Phil2222 Profile Picture
    19 on 12 Jun 2024 at 12:39:50
    Re: Patch all items in gallery with text from text input outside gallery

    @AmĂ­nAA,

    I was sure I tried that but clearly I done something wrong as this time it worked fine.

     

    Thanks for your help

  • Verified answer
    AmĂ­nAA Profile Picture
    1,105 Super User 2025 Season 2 on 12 Jun 2024 at 11:55:20
    Re: Patch all items in gallery with text from text input outside gallery

    Greetings!

    Well, as far as I'm concerned and understanding that there is only one textbox outside the gallery, just adding the column pointed to the textbox should work . . .

     

    ForAll(
     galBasket.AllItems,
     Patch(
     'Consumable Transactions',
     //Defaults('Consumable Transactions'),
     {
     Title: ThisRecord.Title,
     Qty: Value(ThisRecord.Qty),
     Transaction_ID: (ThisRecord.Transaction),
     'Your comment column': yourtextbox.text
    
     }
     );
     Patch(
     'Consumable Tools',
     LookUp(
     'Consumable Tools',
     ThisRecord.ID = Transaction
     ),
     {'In Stock': InStock - Value(Qty)}
     );
     
    );
    Clear(colBasket);
    Notify (
     "Update Successful",
     NotificationType.Success,
     5000
    )

     

     

    Hopefully this works for you. Let me know if you need any more help!

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete