Hi all,
I have a dropdown with the following items:
Items=SPInstructors.InstructorName
These Items are in form of text in the SPInstructors list
The choice of this dropdown now needs patched into another SP list named SPfeedback. The column it will be patched into is text as well. I have the following patch code:
Collect(
col_Submit,
{
Title: "Comments",
Answer: CommentsInput.Text,
Instructor: box_Instructor.Selected,
Session_detail: box_SessionDetail.Selected
}
);
ForAll(
col_Submit,
Patch(
SPfeedback,
{
Title: Title,
Answer: Text(Answer),
Stage: Text(First(Stage).Value),
Session_Type: First(Session_Type).Value,
Comment_Grade: Text(Comments_Grade),
Session_detail: (Session_detail).Value,
Instructor: (Instructor).Value
}
));
The patch works fine without the last line ("Instructor: (Instructor).Value"). If I add the last line I get the error saying that it is not a record that I am putting in... any ideas where I went wrong? I think its because the dropdown is effectively a lookup from a SP list and thus the formatting might be erroneous..
Many thanks,
Tom
Solved! Go to Solution.
That runs fine by the looks of it (the name corresponds to the one selected in the dropdown)...
It's the patching to the other sharepoint list that is acting weird.
Yes - that was what I was trying to establish
So col_Submit.Instructor.InstructorName is definitely a Text value.
I suspected the issue was at the other end when I saw your error (and also when the label produced a result on the formula) - the target is expecting a table value. To really test this, Patch your value to another text field in the table and see if it works.
This is embarrassing... The target SP column was defined as Person. I apologize that I didn't check that earlier!
Thus this code that you showed me in the beginning worked:
);
ForAll(
col_Submit,
Patch(
flt_EATfeedback,
{
Title: Title,
Answer: Text(Answer),
Stage: Text(First(Stage).Value),
Session_Type: First(Session_Type).Value,
Comment_Grade: Text(Comments_Grade),
Session_detail: Session_detail.Value,
Instructor: box_Instructor.Selected.'Instructor Name'
}
)
);
Out of interest: What would the code look like if both SP lists had their respective column defined as person?
Very many thanks for the time and the effort you spent to help me, I really appreciate it!
Thanks @tupues ,
There had to be something wrong - strangely I had started typing out an updated request asking for a screen shot of your SharePoint field definition as that was the only place left to go.
Person fields are a strange beast to manage - they are a "complex" field type. To update or create - you need the following for the current user as defaults - obviously you can add different and additional values.
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName:User().FullName,
Claims:"i:0#.f|membership|" & Lower(User().Email),
Department:"",
Email:User().Email,
JobTitle:"",
Picture:""
}
Anyway, I am offline shortly (10:20pm here) - I am glad we sorted it.
Thank you so much. Have a great remainder of the evening!
Best regards,
Tom
User | Count |
---|---|
238 | |
114 | |
94 | |
58 | |
31 |
User | Count |
---|---|
286 | |
133 | |
106 | |
63 | |
57 |