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?
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)
Hi @BHaapi ,
Can you share a bit more on the context? Are these controls (FMFacility etc.) inside a gallery?
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.
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
}
)
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.
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?
No the mentor is just one person. they are office365 lookups. the mentee has many available, the mentor is only one.
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
}
)
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional