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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Lookup Gallery and Pat...
Power Apps
Answered

Lookup Gallery and Patching to SP List with GateEntry Number

(0) ShareShare
ReportReport
Posted on by 527

Hi

 

I have 2 Screens

 

Screen 1 - Patch to Share Point

 

Enter Data in Gallery (Blank Vertical & Add rows if required) and Patch to SharePoint List and generate ID Number G00001130721( Prefix & ID & Today) for each entry ( Irrespective of number of rows)

 

Screen2 - Gallery Edit and Patch Data to SharePoint

 

Ex:

I have to patch

 3 rows from Screen 2 gallery and ID Number is G00001130721 for all 3 rows to Share Point.

 

I have Called the ID number in Screen 2 with Filter

 

Now I am edit the data as required in gallery. in screen 2

 

I have Used the following code and patching the First row only in SharePoint. Need to Patch all 3 rows in sharepoint.

 

ForAll(RepeattingTable_2.AllItems,

Patch(

StoreInward,LookUp(StoreInward,GateEntryNo=TextInput2.Text),

{

PoNumber:SI8_1.Text,

GrmJrmGrnNo:SI9_1.Text,

GrmJrmGrnDate:DatePicker4_1.SelectedDate,

RdcRgpNo:SI9_2.Text,

RdcRgpReceivedDt:SI10_1.Text,

RdcRgpPostDt:DatePicker5_1.SelectedDate

}))

 

Please suggest to achieve.....

 

Thanks & Regards

Categories:
  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    Hi @knsrinath ,

    Firstly your Patch criteria - you are using a lookup to a field called GateEntryNo - this will only find one record, meaning all items will be progressively patched to it resulting in only the last one being recorded (each will overwrite the one before).

    Also where are you running this code from (inside or outside the gallery?) and can you please specify which of the controls as inside and outside the gallery. 

     

    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.

  • knsrinath Profile Picture
    527 on at

    Hi @WarrenBelz 

    It is happening exactly and over writing.

    I am running this code with the help of button.

     

    Thanks & Regards

  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    @knsrinath ,

    So what records (how do you identify them) are you trying to write to ? As I mentioned, your Patch filter only gets one record.

  • knsrinath Profile Picture
    527 on at

    @WarrenBelz

     

    Can you suggest any alternate method.

     

    Thanks & Regards 

  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    @knsrinath ,

    Is TextInput2.Text inside or outside the gallery ?

  • knsrinath Profile Picture
    527 on at

    @WarrenBelz 

     

    TextInput2.Text is out side the gallery.

     

    Thanks & regards

  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    @knsrinath ,

    That is what I assumed from the result you were getting. Try

    ForAll(
     RepeattingTable_2.AllItems As aPatch,
     Patch(
     StoreInward,
     {ID:aPatch.ID},
     {
     PoNumber:SI8_1.Text,
     GrmJrmGrnNo:SI9_1.Text,
     GrmJrmGrnDate:DatePicker4_1.SelectedDate,
     RdcRgpNo:SI9_2.Text,
     RdcRgpReceivedDt:SI10_1.Text,
     RdcRgpPostDt:DatePicker5_1.SelectedDate
     }
     )
    )

    Assuming all the other values are also outside the gallery.

     

    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.

  • knsrinath Profile Picture
    527 on at

    Hi @WarrenBelz 

    I have tried, Now all 3 rows are patching with same number. (Over writing the above 2 rows)

     

    Thanks & Regards

  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    @knsrinath ,

    That should not happen as you are using the ID which is unique to the record in the gallery and will Patch to each ID that matches the one in the Gallery. Firstly please post the exact code you are using and also the Items of the Gallery.

  • knsrinath Profile Picture
    527 on at

    Hi @WarrenBelz

     

    IMG_20210717_120522.jpg

    Green Color got from SharePoint List with Filter Function using TextInput2.Text outside of the gallery. All 3 rows GateEntryNo is same as G00025130721 in SharePoint.

     

    Blue Color needs to patch to sharepoint list for the same GateEntryNo G00025130721.

     

    I have Used the following Code and patching the First row only in SharePoint. Need to Patch all 3 rows as shown in Blue color marking.

     

     Code

     

    ForAll(RepeattingTable_2.AllItems,

    Patch(

    StoreInward,LookUp(StoreInward,GateEntryNo=TextInput2.Text),

    {

    PoNumber:SI8_1.Text,

    GrmJrmGrnNo:SI9_1.Text,

    GrmJrmGrnDate:DatePicker4_1.SelectedDate,

    RdcRgpNo:SI9_2.Text,

    RdcRgpReceivedDt:SI10_1.Text,

    RdcRgpPostDt:DatePicker5_1.SelectedDate

    }))

    The above code is using with help of Button.

    I have not used and code in Gallery Items.

    Thanks & Regards

     

     

     

     

     

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard