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 / On Patching a Repeatin...
Power Apps
Unanswered

On Patching a Repeating Table in Galllery, Items are created and one additional Blank Row with partial fields updated

(0) ShareShare
ReportReport
Posted on by 77

Hi, I was trying Repeating Table Gallery Patch into Sharepoint List

The Patch function well, but with an additional blank row. as per image below

Michael_Yen_1-1637021969426.png

This the Button OnSelect formula:

 

Patch(collTrainingEmpRecords,ThisItem,
{EmpName:ComboBoxEmployee.Selected.field_EmployeeName,EmpID:Value(ComboBoxEmployee.Selected.Title),
TrgTitle:DataCardValue1.Text&ComboBoxTrainingCal.Selected.Title,
Department:ComboBoxEmployee.Selected.field_SectionDescription,
TrgID:Value(TextInputTrgID.Text)&ComboBoxTrainingCal.Selected.ID,
TrgDateStart:DateValue(DateValue1)&DateTimeValue(ComboBoxTrainingCal.Selected.field_DateStart),
TrgCPDPoints:DataCardValue6&ComboBoxTrainingCal.Selected.CPDPoints,
TrgCPDCategory:DataCardValue10.Text&Dropdown1.SelectedText.Title&ComboBoxTrainingCal.Selected.field_CPDCategories,
TrgHours:DataCardValue7&ComboBoxTrainingCal.Selected.field_Hours,
TrgCPDDesc:Dropdown1.Selected.CategoryDescription});
Collect(collTrainingEmpRecords,{EmpName:"",EmpID:"",Department:"",TrgTitle:"",TrgID:"",TrgDateStart:"",TrgCPDPoints:"",TrgHours:"",TrgCPDCategory:"",TrgCPDDesc:""})

 

SharepointForm OnSuccess Formula:

ForAll(collTrainingEmpRecords,If(!IsBlank(TrgTitle),Patch('HR Training Records',Defaults('HR Training Records'),{EmployeeName:EmpName,EmpNo:Value(EmpID),Department:Department,Title:TrgTitle,CPDHours:Value(TrgHours),CPDCategory:TrgCPDCategory,CPDPoints:Value(TrgCPDPoints),DateStart:DateTimeValue(TrgDateStart),CPDDescriptionText:TrgCPDDesc})));ResetForm(Self); RequestHide()

 

I checked some similar issue in this Forum, but was not able to understand fully why the Row with partially updated columns appear.

 

Appreciate if anyone could shed some light on this Patch behaviour

 

Thank you

Categories:
I have the same question (0)
  • PTBBSolutions Profile Picture
    691 on at

    Hi @Michael_Yen ,

     

    Why do you use a form and a gallery together?

     

    The blank record in the gallery is coming from:

    Collect(
    	collTrainingEmpRecords,
    	{EmpName:"",
    	EmpID:"",
    	Department:"",
    	TrgTitle:"",
    	TrgID:"",
    	TrgDateStart:"",
    	TrgCPDPoints:"",
    	TrgHours:"",
    	TrgCPDCategory:"",
    	TrgCPDDesc:""
    	}
    )

    You are adding (collecting) a blank record to the already existing collection. I guess what you have tried to achieve with this is to empty the collection. If yes, just put Clear( collTrainingEmpRecords).

  • Michael_Yen Profile Picture
    77 on at

    Hi PTBB

    Thank you very much for responding with your guidance

     

    I tried to adopt the steps outlined by Shane in his video. My original intention was to use the Form to create a Sharepoint List if there is only one entry and users have an option to use the Gallery Repeating Table to insert multiple records if required

     

    The IsBlank in the OnSuccess formula was supposed to prevent the blank  record from being created at the last entry in Sharepoint list.

     

    I finally discovered the cause for the blank row- I was mapping the DataCard properties to a wrong control. After remapping the Controls, the information now is successfully updated in the Sharepoint list.

     

    Thanks again for your help!

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Michael_Yen 

     

    Adding some information.

     

    To create a blank row in a collection

    Collect(collTrainingEmpRecords, {})

    To create  a blank row with the default value from the source then

    Collect(collTrainingEmpRecords, Defaults(Datasourcename))

     
    Thanks,
    Stalin - Learn To Illuminate

  • Michael_Yen Profile Picture
    77 on at

    Cool! Thanks Stalin for your sharing

     

    Michael

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 538

#2
WarrenBelz Profile Picture

WarrenBelz 420 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard