Dec 25 2022 11:58 PM - edited Dec 26 2022 12:23 AM
I have a flow which will get file properties from a library that contains a managed metadata column. But when I run the flow, the term label value returns some ID instead of the actual string value.
The actual Label value should be something like "Fire Protection" and not 109.
I can't find a way to get the Label string using any other way.
Is this the actual behavior or it's a bug? I'm not sure.
Is there any other way to get the Label value?
Thanks.
Dec 28 2022 02:56 AM
Hi @dotem
I tried to replicate your scenario but I was able to get the managed metadata column value correctly in the flow.
My column name is 'MMD', and I used the step 'Get file properties' (SharePoint) and was able to get the output as below :
Do you not get the same output when using the step 'Get file properties'?
How is your term store values configured?
Regards,
Dec 28 2022 07:25 AM
Hi @dotem ,
this issue depends on how exactly you are accessing the file properties from the document library.
This for example works without problems if i use the action "Get files (properties only)".
But i get the same (wrong) results as you, if i use an "Send an HTTP request to SharePoint" action like this
_api/web/lists/getbytitle('<ListName>')/items
If you use the "Send an HTTP request to SharePoint" action you should take a look at the following article for a workaround to that case:
"https://sympmarc.com/2017/06/19/retrieving-multiple-sharepoint-managed-metadata-columns-via-rest/" .
The idea is to expand the "TaxCatchAll" Field like this (MM is my metadata colum)
_api/web/lists/getbytitle(<ListName>)/items?$select=Title,MM,TaxCatchAll/ID,TaxCatchAll/Term&$expand=TaxCatchAll
Now you will still get the wrong value for die metadata column, but you will now get an additional "TaxCatchAll" property where you can lookup the correct label for the id
"MM": {
"__metadata": {
"type": "SP.Taxonomy.TaxonomyFieldValue"
},
"Label": "5",
"TermGuid": "cd04183c-45ce-4e21-b53d-c36659f5cee9",
"WssId": 5
},
"TaxCatchAll": {
"results": [
{
"__metadata": {
"id": "771205b8-8892-442b-a76a-a4e22a786883",
"type": "SP.Data.TaxonomyHiddenListListItem"
},
"ID": 5,
"Term": "Term2"
}
]
}
If it is not the case that you are using the "Send an HTTP request to SharePoint" action to get the file metadata...
Which PowerAutomate action exactly are you using to get the properties from SharePoint?
Dec 14 2023 12:36 PM
I'm having the same issue. I'm using the "Get files (properties only)" action.
This is what I see in the raw output.
I haven't been able to figure out how to get the actual label name.
Dec 16 2023 12:09 PM
I have had a similar issue, when i am running Power Automate, Flow using the SharePoint, Get List Item, to return metadata value, labels.
the output returns the metadata ID, not the label that was requested.
This does not works on some lists and other are fine, they return the label.
After testing, lists that have been created using the 'From existing list' option,
create lists with Content Types, that are local to the list, (there parent is the Item)
Where as the lists that are working as expected, have been created manually with the Site Column and the Content Type being set up first, in the site, then added to a new list. This give you a parent Content Type in the site content type list
Note: Doing this manually or using PowerShell to the the list up both create list that does not have the metadata issues with Power Automate flows.
To resolve this I have rebuilt my problematic lists setting up the Content Type first manually (or with PowerShell) adding them to my new list and migrated the data.
Note: I create list like this ordinarily, but i notices this when you let the users lose with list creation, and they turn in to a 'Critical System' that needs some automation applied.
anyway, hope this helps.