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.  

3 REPLIES 3
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.

Mentor365_Mike
New Member

Hi. I think i figured it out. You need to update the hidden field e.g. Fieldname_0. But that cannot be referenced by the name itself but only the static name. You can find the static name for example with SharePoint online browser:

staticname.gif

 

So the xml in above example would be

<Method Name="SetFieldValue" Id="4" ObjectPathId="3">
<Parameters>
<Parameter Type="String">m7c4f705de6b440a9dd704afa238c201</Parameter>
<Parameter Type="String">Ekonomi|f4d31f9f-9165-4167-814c-e0d5b3cc4b67</Parameter>
</Parameters>
</Method>

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,148)