Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Patch with Managed Metadata type

Posted on 27 Nov 2024 01:57:43 by 8
I have a patch function that creates new records in a Sharepoint list. It works well. However, it does not work when I do not populate the "Trade" Managed Metadata field. *Note this is not a required field in the list. Any ideas why this is happening?
 
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: {
            '@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
    }
);
If(
     // check if there were any errors when the item was submitted
    !IsEmpty(Errors('List-Evidence_Tracker')),
     // if true, show any error message
    Notify(
        "Criteria submission failed",
        NotificationType.Error
    ),
     // else, go to success screen
    ResetForm(frmAddEvidence);
    Navigate(scrnMainScreen);
   
);
  • Suggested answer
    CA1105 Profile Picture
    CA1105 210 on 27 Nov 2024 at 05:59:39
    Patch with Managed Metadata type
    Would you pls try to patch that field as null and see what happen? I think it should work but I wanna see the results.
  • MZ-18110459-0 Profile Picture
    MZ-18110459-0 8 on 27 Nov 2024 at 05:26:42
    Patch with Managed Metadata type
    No dependencies. It is a Term Store that is used to populate a drop down list on the form. It is not a required field, so it should be ok to leave it blank/unselected for the patch. 
    Thanks,
    Maria.
  • ronaldwalcott Profile Picture
    ronaldwalcott 764 on 27 Nov 2024 at 05:09:47
    Patch with Managed Metadata type
    Are there any dependencies on this field?

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,129

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,797

Leaderboard