cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmmiller
Regular Visitor

Using the System Update Method in a Send an HTTP Request to SharePoint to update a taxonomy field

Hi, All.

 

I am following this blog by Mikel Svenson to update a managed metadata field using MS Flow and the SharePoint HTTP Request action without triggering an event:  https://www.techmikael.com/2019/04/disable-event-firing-when-flow-updates.html

 

The following is what I placed in the body. 

<Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="Javascript Library">
    <Actions>
        <Method Name="SetFieldValue" Id="4" ObjectPathId="3">
            <Parameters>
                <Parameter Type="String">ContentStatus</Parameter>
                <Parameter Type="String">Pending|f267472a-1a88-4d35-b179-e54c7b040002</Parameter>
            </Parameters>
        </Method>
        <Method Name="SystemUpdate" Id="5" ObjectPathId="3" />
    </Actions>
    <ObjectPaths>
        <Property Id="1" ParentId="0" Name="Web" />
        <Method Id="2" ParentId="1" Name="GetList">
            <Parameters>
                <Parameter Type="String">/sites/xxx/SitePages</Parameter>
            </Parameters>
        </Method>
        <Method Id="3" ParentId="2" Name="GetItemById">
            <Parameters>
                <Parameter Type="Number">@{triggerBody()?['ID']}</Parameter>
            </Parameters>
        </Method>
        <StaticProperty Id="0" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" />
    </ObjectPaths>
</Request>

If I don't use single quotes around the taxonomy field choice Pending|xxxGUIDxxx then I get Error Info: null in the output with a status code of 200 but the field is not updated.  If If I place single quotes around the parameter (which I know is not correct), I get "The given guid does not exist in the term store":

"ErrorInfo": {
      "ErrorMessage": "The given guid does not exist in the term store",
      "ErrorValue": "23,ContentStatus",
      "TraceCorrelationId": "0990f19e-80a1-0000-41f2-e62db381e24a",
      "ErrorCode": -2130575155,
      "ErrorTypeName": "Microsoft.SharePoint.SPFieldValueException"

EDIT: This works for a text field but not managed metadata.  I need to be able to update the item's taxonomy field without creating an infinite loop for my client.

EDIT:  I have tried 'Term|xxxguidxxx;' and Term|xxxguidxxx; and just Term|xxxguidxxx (which I feel should be appropriate) The GUID is correct.  

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @mmmiller ,

 

Please find if the following blog could be helpful for your scenario:

https://joannecklein.com/2018/02/19/microsoft-flow-update-sharepoint-columns/

 

This blog could be a reference as well:

https://flow.microsoft.com/en-us/blog/managed-metadata-tago/

 

Best regards,

Mabel       

   

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PeacerichT
Regular Visitor

Have you @mmmiller  (or anyone else maybe) been able to solve this? Given the end note by Mikael Svenson:

Note: I have not dug into how to set for example people, lookup and taxonomy fields using this approach, but it’s certainly doable and you can check the network trace for JSOM/CSOM calls if you are developer to see what is actually being sent.

I guess updating a metadata field might need another data type than String in the Parameter Type=""? Or is it just a question of finding the correct way to reference the metadata tag? Or are there more changes needed to get it to work?

Any help would be appreciated.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (84,215)