Hello All,
hope you are all doing good....and hope someone will be able to help me
I have a form linked to a SharePoint list. Since i customized some fields, i have to use a Patch in order to save the form.
This form contains multiple fields but includes 3 people fields (multiple selection enabled) and the user also needs to save attachments.
I collect my users to 3 collections at the very top of the OnSelect of my "Save" button. After this i have the Patch function ...
// Same kind of function to collect users from the 2 other fields
ForAll(
UserExpertValue.SelectedItems,
Collect(
CollUserExpert,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & ThisRecord.Email,
Department: "",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle: ".",
Picture: "."
}
)
);
// Saving data to the list
Patch(
MyList,
First(
Filter(
MyList,
ID = Value(IDValue.Text)
)
),
{
Title: TitleValue.Text,
Country: CountryValue.Selected,
'Instrument Type': InstrumentTypeValue.Selected,
'Confidential Service': ConfidentialServiceValue.Value,
GDPR: GDPRValue.Selected,
'Root Cause of service': RootCauseValue.Text,
'New or Existing Business': NewExistingBusinessValue.Selected,
//copying the selected users to a text field - keeping the existing content
ContactsTxt: ContactsTxtValue.Text & Concat(
CollContacts,
DisplayName & " "
),
RiskContactTxt: RiskContactTxtValue.Text & Concat(
CollRiskContacts,
DisplayName & " "
),
UserExpertTxt: UserExpertTxtValue.Text & Concat(
CollUserExpert,
DisplayName & " "
)
},
//Used to save the attachements
MyListForm.Updates
);
Keeping the formula this way was working for the last 3 months and now it suddenly doesn't anymore.
Trying to find a solution, I moved the user saving part (at the bottom of the Patch) to a new Patch function that i put between the 2 parts of the formula (right before the Patch) . this was collecting my users, adding them to my list but resetting all the other changes on my form so i had to do them again and the data was finally saved.
then i got everything back and removed the attachment line (at the bottom of the patch) to put it after the Patch function in another Patch but also without any Patch. here...a strange behaviour again. while in my personal environment, everything works but shows an "unknown error" when i recreate this at work, it shows no error but it doesn't work at all.
so i really don't know what happens and how to solve this.
I just want to save data, people and attachments from a form into my SharePoint list....
does anyone have an idea what happens and how i could solve this please ?
Thanks a lot for your help.

Report
All responses (
Answers (