Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Gallery Patch function copying same data from last row to sharepoint

(0) ShareShare
ReportReport
Posted on by 227

I have been trying to patch my repeating table (gallery with multiple rows) to my SharePoint list, however it keeps copying the data from the last row to all of the added rows.  See code for submit button, add event button, and the results of the patch button.

Additionally, the two collections in the app are blank when clicking the patch button. It only shows one column populated.

Help on this will be greatly appreciated!

 

Add event button:

NPatel12498_0-1680029436255.png

 

 

Submit Button:

NPatel12498_1-1680029494627.png

 

 

Gallery:

NPatel12498_2-1680029562581.png

 

 

ColSelectedMeals:

NPatel12498_4-1680029177209.png

ColMealDetails:

NPatel12498_3-1680029603271.png

 

 

 

SharePoint List after Submit button (patch)

NPatel12498_0-1680030081701.png

 

 

 

  • BCBuizer Profile Picture
    22,012 Super User 2025 Season 1 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi  @NPatel12498,

     

    This is very strange as in the course of this topic you have posted two contrasting error messages:

     

    This was posted first, stating 'RequiredMeals' is a text column:

    BCBuizer_0-1680276759451.png

    In you most recent post it is now stating 'RequiredMeals' is a mutitselect choice column (or similar):

    BCBuizer_1-1680276788136.png

    The formula I posted was based on the first error, where I was trying to push a text to 'RequiredMeals', but now that is not working because the column type has changed. Did you do that?

     

    If 'RequiredMeals' is indeed expects a table, please try:

    Patch(
     ColMealDetails,
     ThisItem,
     {
     TitleID: TitleID.Text,
     EventDate: Eventdate.SelectedDate,
     RequiredMeals: RequiredMeals.SelectedItems,
     EventDuration: EventDuration.Text,
     ****Attendees: ****Attendees.Text,
     Non****Attendees: Non****Attendees.Text
     }
    )

     

  • NP-18101421-0 Profile Picture
    227 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi,

    There are no squiggly lines at all showing in the formula. But all of the input fields I am putting the formula for the OnChange property are showing red x's. Do you think maybe the other formulas within the Add Event button are causing the error?

     

    Add event button formula:

    NPatel12498_3-1680274367398.png

     

    Here's the formula bar:

    NPatel12498_0-1680274073753.png

    Here is the error message within the flow checker that is appearing for each input field:

    NPatel12498_1-1680274258747.png

     

    NPatel12498_2-1680274276176.png

    These are the red x's:

    NPatel12498_4-1680274424910.png

    Disregard the input field below required meals.

     

  • BCBuizer Profile Picture
    22,012 Super User 2025 Season 1 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi @NPatel12498,

     

    Based on what you're showing me, this should be working. Can you please post the screenshot that includes the red squiggly lines to indicate where in the formula the issue is?

  • NP-18101421-0 Profile Picture
    227 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    This is still not working and it is giving the same errors. 

     

    Here is the display fields for RequiredMeals:

    NPatel12498_0-1680193639244.png

     

  • BCBuizer Profile Picture
    22,012 Super User 2025 Season 1 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi @NPatel12498 ,

     

    Thanks for the detailed error text. The below should fix the issue:

     

    Patch(
     ColMealDetails,
     ThisItem,
     {
     TitleID: TitleID.Text,
     EventDate: Eventdate.SelectedDate,
     RequiredMeals: Concat(RequiredMeals.SelectedItems, Value, ", "),
     EventDuration: EventDuration.Text,
     ****Attendees: ****Attendees.Text,
     Non****Attendees: Non****Attendees.Text
     }
    )

     

    If this doesn't work, please share the DisplayFields property of the RequiredMeals combo box.

  • NP-18101421-0 Profile Picture
    227 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    There are no errors displayed with red lines in the formula bar, but in the flow checker there are errors. Additionally required meals is a multi select column, up to 3 values can be selected within this dropdown. It is supposed to be collected as a collection because of that reason. See below

    NPatel12498_0-1680112171818.png

    NPatel12498_1-1680112187261.png

     

     

    NPatel12498_2-1680112204543.png

     

    NPatel12498_3-1680112216950.png

     

  • BCBuizer Profile Picture
    22,012 Super User 2025 Season 1 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi @NPatel12498 ,

     

    Apologies, I got some things mixed up before. Please try:

     

    Patch(
     ColMealDetails,
     ThisItem,
     {
     TitleID: TitleID.Text,
     EventDate: Eventdate.SelectedDate,
     RequiredMeals: RequiredMeals.SelectedItems,
     EventDuration: EventDuration.Text,
     ****Attendees: ****Attendees.Text,
     Non****Attendees: Non****Attendees.Text
     }
    )

     

    What is important, is that the names of the controls are in the function correctly. For instance I found a typo in EventDate. For saftery, can you share a screenshot that shows the names of the controls in the gallery?

  • NP-18101421-0 Profile Picture
    227 on at
    Re: Gallery Patch function copying same data from last row to sharepoint
    Patch(
     ColMealDetails,
     ThisItem,
     {
     TitleID: ThisItem.TitleID,
     EventDate: ThisItem.Evendate,
     RequiredMeals: ThisItem.RequiredMeals,
     EventDuration: ThisItem.EventDuration,
     ****Attendees: ThisItem.****Attendees,
     Non****Attendees: ThisItem.Non****Attendees
     }
    )

     

    The code has less errors after I take out the .text, .selecteddate out of the formula. But this is what I have currently and it is still throwing errors. Disregard the **** that is just data protection on my end. 

  • BCBuizer Profile Picture
    22,012 Super User 2025 Season 1 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi @NPatel12498 ,

     

    Can you share the formula please?

  • NP-18101421-0 Profile Picture
    227 on at
    Re: Gallery Patch function copying same data from last row to sharepoint

    Hi,

     

    I have adjusted the formula with the correct column names but it is still giving me errors. 

     

    NPatel12498_0-1680100981394.png

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard