12 thoughts on “Microsoft Flow: update Managed Metadata Column of a Document Set

  1. After more testing, here is what I am seeing:

    1.) Create the document set using HTTP Request to SharePoint (as you have outlined). This works fine.

    2.) Update the document set properties using HTTP Request to SharePoint (as you have outlined). On the update I am updating text fields and a managed metadata field.
    — The text fields update fine.
    — The managed metadata field continues to be blank.

    3.) I then went into the document set and manually selected an arbitrary value for the managed metadata field.

    4.) Next I re-ran the Flow to update the document set managed metadata field using HTTP Request to SharePoint. Then the update works – the managed metadata field is filled in with the correct value.

    Any ideas on why it seems that a value already has to be in the managed metadata field before the update works? I am consistently seeing this behavior as I am testing and analyzing.

    Thank you again.

    1. Hi Paige,
      The extra work at the moment is that you need to have the ID of the Document Set. Right after creation of a new Document Set, you can get the ID from the output of the creating HTTP request but when you update an existing one you need to get the ID first.

      I cannot reproduce any issues… I have the same Flow being triggered on a creation/modification of a SharePoint List Item and this Flows creates a new Document Set if not already existing and updates an existing Document Set if there is an existing one.Both update HTTP request actions are exactly the same in my Flow.

      You are using the GUID of the Managed Metada Column and the right SP.Data in the Body of the HTTP request, as explained here: https://knowhere365.space/microsoft-flow-update-sharepoint-document-set/

      I did read something about Managed Metadata having a Default Value could cause some issues –> do you have a Default Value configured for the Managed Metadata Column in the Document Library with the Document Sets?
      If so –> can you check without a Default Value

      1. Yes, I am getting the newly created document set ID to use in the call. I can set the text field property with no issues. It is the managed metadata field property that will not set unless there is a value there already.

        For this document set, no default value is in place.

        (I do have this same problem with another document set that does have a default value in a managed metadata field…. it won’t set either, but text values do get set.)

        It is a very curious issue. I will keep looking. Thanks again.

          1. I ended up trying one more method, and oddly enough this is working so far.

            Rather than using the HTTP Request action I used the Update Item SharePoint action. Within the Body of the action I used the following:

            “Field_x0020_Name”: [
            {
            “Value”: “-1:#|1b344941-ff1c-4db0-b57d-cdeb26cc3bf3;-1:#|f3e13b30-247f-4f35-bb4f-e833724f2d46”
            }
            ]

            I did not have to use the hidden name or append _0 to the field name. Not sure why using the Update Item action worked, but it set the managed metadata field without me having to manually insert a value initially.

            I will continue to test, but I really appreciate the time you have taken to help me figure this out. If in the end this still causes problems I will post in the Community Forum as you have suggested and tag you.

            Thanks again!

  2. Thank you for responding so quickly. I will continue to investigate as this used to work. One more question. You indicated in your post that “This will only update the managed metadata if the value is empty. if there is already a value some extra work is needed.” What are the extra steps in this case if data is already in the field? Thank you.

  3. Hi Paige, if you use the Internal Hidden Column Name of the target column and the Label|GUID combination then the update should also work. You just have to make sure to use the correct ID of the target library.

    Example of HTTP request to SharePoint that still works for me today to update existing items with existing values:
    URI
    _api/web/lists(guid’d4969af7-c0ee-4961-ad93-b26d8f19dfc5′)/items(196)

    Headers
    {
    “Content-Type”: “application/json;odata=verbose”,
    “Accept”: “application/json;odata=verbose”,
    “X-HTTP-METHOD”: “MERGE”,
    “If-Match”: “*”
    }

    Body
    {
    “__metadata”:{
    “type”:”SP.Data.LibraryWithSetsItem”
    },
    “DocumentSetDescription”:”Set created by : Django Lohn”,
    “m3ab6bbabf1e4efaa8bb1e6cf9a3cf9a”:”To do|81ab7a4c-81bf-4b2c-8fd6-d72ac08bdb08″,
    “h9846defb6324a1cb093e17339e9c7ad”:”Power Apps|50e4535b-2b61-4d0b-a3c5-210467d1a82c;Power Automate|b6af564d-cd77-43b1-9249-a1a5e099068f;SharePoint Online|fd0b2a0d-b14c-414c-a804-73954ab0674b;”
    }

    I have had other people also complain about this concept not working, but I have flows from over a year that are still working fine so without more info about what is failing at your side, I can only say to follow the instructions to the letter.

  4. Also, this used to work perfectly for me (in cases where there is not data already in the managed metadata field), but for the past 6 months I can no longer set the values. Do you know if the technique has changed or if there are other oddities that may be in play? Thanks so much for your excellent posts!

  5. Hi – do you have a workaround for when there is already data in the managed metadata column? Referring to your note above:

    This will only update the managed metadata if the value is empty. if there is already a value some extra work is needed 😒

  6. I think the screenshot for #3 is not appropriate. It doesn’t have the internal field name ‘varMM_BacklogItemStatusHiddenInternalName’

Leave a comment