A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi Maria,
As per the shared information, it looks like you're encountering an issue with the "Trade" Managed Metadata field when it is left blank. In this situation, as community moderators here mainly focus on out-of-box features in SharePoint Online, to make sure you can get the professional and appropriate support to help modify the patch function, please post in Microsoft Q&A Community, which is the specific channel to handle such developed customization. You may use SharePoint or SharePoint Development tag when" Ask a question".
Meanwhile, I will keep your thread open here and welcome other community members or MVPs may share their suggestions and experience for you. And from my online search, some users addressed the issue to add a condition to check if the "Trade" field is empty and it will be set to Blank() instead of trying to patch an empty Managed Metadata object.
Please correct me if I made any misunderstanding or if there have anything else I can do for you.
Your patience is highly appreciated. Hope you a nice day and stay safe!
Best Regards,
Mia
Patch( 'List-Evidence_Tracker', Defaults('List-Evidence_Tracker'), { CriteriaID: LookUp('List-Criteria', Criteria = DataCardValueEvCriteria.Selected.Value, ID), EvidenceTypeID: LookUp('List-EvidenceType', Title = DataCardValueEvType.Selected.Value, ID), 'Evidence-Title': DataCardValueEvTitle.Text, 'Link to Evidence': DataCardValueEvLink.Text, ResponsibleID: LookUp('List-Responsible', Title = DataCardValueEvResponsible.Selected.Value, ID), Trade: If( IsBlank(DataCardValueEvTrade.Selected.TermGuid), Blank(), { '@odata.type': "Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy", TermGuid: DataCardValueEvTrade.Selected.TermGuid, WssId: DataCardValueEvTrade.Selected.WssId, Label: DataCardValueEvTrade.Selected.Label, Path: DataCardValueEvTrade.Selected.Path, Value: DataCardValueEvTrade.Selected.Value } ), Subcontractor: DataCardValueEvSubcon.Text, 'Planned Collection Date': DataCardValueEvPlannedDate.SelectedDate, 'Actual Collection Date': DataCardValueEvActualDate.SelectedDate, 'Submitted to ESDC?': DataCardValueEvSubmitESDC.Value, 'Collection Status Comments': DataCardValueEvComments.Text } );