Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Getting Metadata Guid from name
donundeen
Is there a way, Using the API to get the Guid of a metadata field, from the name?
thanks!
don undeen
Metropolitan Museum of Art
Find more posts tagged with
Comments
msrinivas
Webservices or COM API?
Just out of curiosity why would you want to do it that way when you know that metadata name can be easy changed?
donundeen
Webservice.
it can be changed, but highly unlikely in our setup; it would ruin a lot of people's workflows if anyone did that.
Because we have multiple environments (dev, test, production etc) with the same metadata fields, but with different guids, it's the guids that change between configurations, not the names.
msrinivas
I checked the API guide and do not see a way of doing it.
I am not sure how you set up your different environments but I hope you realize that you can have the same GUIDs in all your environments. That is usually my preferred way of setting up multiple environments so that anything that you code in one environment works in the rest.
I would suggest you consider re-doing your dev and test env. based on the prod env. to make things better.
donundeen
that would be nice, but it's not my job or place to make that sort of thing happen; I've got to work with what I've got.
thanks for taking the time to help and advise.
msnider
There currently isn't a web service call to get a specific metadata by name...e.g. GetMetadataByName.
However, you can get the list of searchable metadata and then iterate over the list looking for the name within that list. While this isn't optimal, it would allow you to get a dynamic guid from a static name....of course, you would want to place this within some sort of initialization routine since you really only want to call it once at start up to initialize each of the different environments.
Mark