cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
johnjohn123
Level: Powered On

Setting a Managed Metadata field inside my code will show it as null inside PowerApp

I have a remote event reciever and inside it i am setting a managed metadata column named "DealStage", as follow:-

 

 

i["DealStage"] = "12e247f8-18ff-46be-95cd-fedc3adf1ddb"; //this represents a term label= New
i.Update();
context.ExecuteQuery();

 

now inside the list view i can see the managed metadata values as follow:-

deal sa.png

 

but if i edit the list item the Deal Name will be null as follow:-

deal sa.png

 

now if i modify the value using power app form, the Deal Stage will be shown correctly .. so not sure what is going on?

2 REPLIES 2
johnjohn123
Level: Powered On

Re: Setting a Managed Metadata field inside my code will show it as null inside PowerApp

any advice on this please?

Community Support Team
Community Support Team

Re: Setting a Managed Metadata field inside my code will show it as null inside PowerApp

HI @johnjohn123 ,

Could you please share a bit more about your scenario?

How do you update the SP List "DealStage" column value?

Further, do you mean "DealStage" column value would be blank when you edit it using custom form app after you set a value for it using your code?

 

The custom form app (created using PowerApps) would pull record value from your SP List directly, no matter which way you use to update the SP List item value.

Please consider enable "Default SP List form" for your SP List rather than custom form from PowerApps, then edit your record again, check if the "DealStage" value has been populated with proper value.

 

Based on the code that you mentioned, I think there is something wrong with it. The "DealStage" Managed Metadata column contains the following properties:

 

{
  __metadata: {type: 'SP.Taxonomy.TaxonomyFieldValue'},
  Label: '<Your Label>',
  TermGuid: '<Term Guid>',
  WssId: -1
}

 

on your side, you need to provide values for all these child properties, then assign the whole child properties object to the "DealStage" column within your code.

Please check and see if the following article would help in your scenario:

https://www.aerieconsulting.com/blog/using-rest-to-update-a-managed-metadata-column-in-sharepoint

 

e.g. You could consider modify your code formula as below (may be you need to convert the following formula into your C# code):

i["DealStage"].TermGuid = "12e247f8-18ff-46be-95cd-fedc3adf1ddb";
i["DealStage"].__metadata= "SP.Taxonomy.TaxonomyFieldValue";
i["DealStage"].Label="<Your Label>";
i["DealStage"].WssId = -1;

i.Update();
context.ExecuteQuery();

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,260)