Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Gallery Patch to Collection Causing Invalid Arguments

(0) ShareShare
ReportReport
Posted on by 134

Hi there! I created a collection based off of a sharepoint list with the simple ClearCollect(FM_NewLog,'Food Mentoring (FM)') in a button. My gallery is coded as such:

OnSelect:

Patch(FM_NewLog,{FacilityLocation:FMFacility.Text,Month:FMMonth.Text,Year:Value(FMYear.Text),Mentees:FMMentee.SelectedItems,Mentor:FMMentor.Selected,Duties:FMDuties.Text,MentoringDate:FMDate.SelectedDate})

and the items inside are all OnChange:Select(Parent)

The gallery includes 2 lookup combo boxes and several other fields which THOUGHT I had coded correctly, but the collection looks like the attached photo and the gallery OnSelect is saying that it is expecting table instead of record.

 

As reference, I am trying to build a gallery that allows users to add data to the Microsoft list, but not view any of it, and I'm worried that not connecting the ThisItem property is messing it all up?

  • BHaapi Profile Picture
    134 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    Hi there! Yes this is in a gallery. the labels are built without spaces then putting spaces in the titles (i provided a copy of what the list is compromised of)

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    Hi @BHaapi ,

     

    Can you share a bit more on the context? Are these controls (FMFacility etc.) inside a gallery?

  • BHaapi Profile Picture
    134 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    gosh look, i just dont know what is going on, the gallery is shooting blanks to the collection, no headers even. and the list is getting the same blanks haha i still cant format the gallery so im guessing theres still something going on.

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    Hi @BHaapi ,

     

    Then try this:

    Patch(
    	FM_NewLog,
     Defaults(FM_NewLog),
    	{
    		FacilityLocation:FMFacility.Text,
    		Month:FMMonth.Text,
    		Year:Value(FMYear.Text),
    		Mentees:FMMentee.SelectedItems,
    		Mentor:FMMentor.Selected,
    		Duties:FMDuties.Text,
    		MentoringDate:FMDate.SelectedDate
    	}
    )

     

     

  • BHaapi Profile Picture
    134 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    i checked it and it was set to one, plus i updated the patch again and it didnt work. i reloaded the data alltogether just to make sure. im still not able to format the patch with .selected or .selecteditems. here is the list, its also just pushing blanks to there, the one filled out was not done on the app.

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    Hi @BHaapi ,

     

    Understood. However, the error text shows that FMMentor should be returning a table, meaning the Mentor column expects a table. That's why I asked. Did you check in the list if the column has been configured correctly?

  • BHaapi Profile Picture
    134 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    No the mentor is just one person. they are office365 lookups. the mentee has many available, the mentor is only one.

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Gallery Patch to Collection Causing Invalid Arguments

    Hi @BHaapi ,

     

    Does the Mentor column have multiselect enabled? If yes, SelectedItems should be referenced instead of Selected to return a table:

     

    Patch(
    	FM_NewLog,
    	{
    		FacilityLocation:FMFacility.Text,
    		Month:FMMonth.Text,
    		Year:Value(FMYear.Text),
    		Mentees:FMMentee.SelectedItems,
    		Mentor:FMMentor.SelectedItems,
    		Duties:FMDuties.Text,
    		MentoringDate:FMDate.SelectedDate
    	}
    )

     

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard