Skip to main content

Notifications

Saving to SharePoint Managed Metadata columns using Patch function

Introduction

This is a continuation of the 'Building PowerApps from Scratch? Use Patch!' blog. This blog shows you how you can use the Patch function to save to a SharePoint Metadata column in a list.

 

SharePoint list

In this example I have a simple SharePoint list which has the following two columns

picture1.png

 

 

The Managed Metadata column is connected to the Taxonomy Term Store.

 

picture2.png

 

 

Here is a video which walks you through how the Patch function was used in the PowerApp to save the item.

 

 

Here is the formula to save the selected item to the Managed Metadata column

 

SharePointColumnName:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
    'TermGuid': DataCardValue.Selected.TermGuid,
    'WssId': DataCardValue.Selected.WssId,
    'Label': DataCardValue.Selected.Label,
    'Path':DataCardValue.Selected.Path,
    'Value': DataCardValue.Selected.Value
  }

 

For this formula to work successfully PROVIDE ALL THE VALUES.

Here is the final Patch formula

 

Patch(ManagedMetadataTest,Defaults(ManagedMetadataTest),{Title: DataCardValue1.Text,
Department:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
    'TermGuid': DataCardValue2.Selected.TermGuid,
    'WssId': DataCardValue2.Selected.WssId,
    'Label': DataCardValue2.Selected.Label,
    'Path':DataCardValue2.Selected.Path,
    'Value': DataCardValue2.Selected.Value
  }})


Conclusion
So all that’s left is the ability to save attachments to a SharePoint list. Once that is possible, PowerApps will be a fully functional and very versatile product to build customized forms built into SharePoint Online or as an App using PowerApps website or mobile app.

Comments

*This post is locked for comments

  • pathakanuj30 Profile Picture pathakanuj30 11
    Posted at
    Saving to SharePoint Managed Metadata columns using Patch function

    Hi Nice article and explanation !!

     

    Can we add multiple tags ? what will be the patch formulae for that ?

  • B8 Profile Picture B8 258
    Posted at
    Saving to SharePoint Managed Metadata columns using Patch function

    Hi 

     

    Can you help me in this please 

     

    Re: How to Patch Text Input Value into a Managed metadata column in SharePoint from PowerApps

  • Sibalukhulu Profile Picture Sibalukhulu 10
    Posted at
    Saving to SharePoint Managed Metadata columns using Patch function

    Hi 

     

    When I use your code I get an error when I put the comma after Patch('Managed Metadata Test', on the comma i get an error:Unexpected characters. Characters are used in the formula in an unexpected way. I think I'm doing something wrong.

     

    May you please assist 

  • MohammadAmer Profile Picture MohammadAmer 11
    Posted at
    Saving to SharePoint Managed Metadata columns using Patch function

    I have an issue to get SharePoint Meta Data Column values. Could you clarify more on the default drop down combo is there any customization on the properties to show the meta data as in my case it can't be retrieved in the drop down and I got error ''the function choices has some invalid arguments".

  • Saving to SharePoint Managed Metadata columns using Patch function

    Hi, first of all thanks for the info.

    I try to figure out how to update a managed metadata column which allows multiple values via the patch function.

    Any idea?

    Regards,

    Geert

  • UB400 Profile Picture UB400 356
    Posted at
    Saving to SharePoint Managed Metadata columns using Patch function

    @darogaelThank you, excellent work. Is there a similar way to do permissions in Sharepoint lists and libraries or do we still have to use App Add-ins and Flow?

  • esoPowerUser Profile Picture esoPowerUser 62
    Posted at
    Saving to SharePoint Managed Metadata columns using Patch function

    Thank you very much! Great example and good explaination.