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 / Gallery Patch to Colle...
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?

Snag_5b94f04.png
Snag_5b9b86d.png
Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    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
    	}
    )

     

  • BHaapi Profile Picture
    134 on at

    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,654 Super User 2026 Season 1 on at

    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

    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.

    Snag_6bfb287.png
    Snag_6bfa1cd.png
  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    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

    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,654 Super User 2026 Season 1 on at

    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

    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)

    Snag_1f13a708.png
    Snag_1f13bdad.png
    Snag_1f138910.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

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 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard