Pulling Managed metadata from a list field

%3CLINGO-SUB%20id%3D%22lingo-sub-39869%22%20slang%3D%22en-US%22%3EPulling%20Managed%20metadata%20from%20a%20list%20field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39869%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20-%20hope%20someone%20can%20help%20with%20this%20before%20i%20lose%20all%20my%20hair!%26nbsp%3B%20I%20have%20a%20sharepoint%20list%20in%20a%20top%20level%20team%20site%20in%20o365.%26nbsp%3B%20In%20a%20subsite%20i%20have%20a%20javascript%20which%20pulls%20a%20row%20from%20the%20list%20in%20the%20parent%20site%20and%20displays%20the%20information%20on%20a%20page%20-%20everything%20works%20fine!%26nbsp%3B%26nbsp%3BI%20then%20have%20a%20same%20setup%20on%20the%20subsite%26nbsp%3B-%20the%20site%20has%20a%20list%20and%20the%20site%20below%20that%26nbsp%3Bthen%20pulls%20from%20the%20parent%20site's%20list%20and%20displays%20on%20the%20page.%26nbsp%3B%20However%2C%20on%20this%20site%20the%20fields%20which%20are%20management%20metadata%20are%20not%20working%2C%20giving%20the%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EObject%20doesn't%20support%20property%20or%20method%20'get_label'%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20oddest%20thing%20is%20that%20the%20same%20managed%20meta%20field%20is%20used%20in%20both%20lists%20and%20the%20javascripts%20work%20identically!%26nbsp%3B%20the%20offending%20line%20is%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EoListItem.get_item('RAG').get_label()%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20idea%20at%20all%20what%20could%20be%20going%20wrong%20-%20like%20i%20say%20I%20have%20the%20same%20code%20in%20both%20scripts%20and%20the%20same%20managed%20metadata%20is%20used%20in%20both%20lists!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-41351%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20Managed%20metadata%20from%20a%20list%20field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-41351%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20made%20a%20new%20discovery.%26nbsp%3B%20The%20script%20that%20pulls%20the%20information%20is%20stored%20at%20site%20collection%20level.%26nbsp%3B%20If%20the%20script%20is%20used%20at%20the%201st%20level%20subsite%20it%20works%20perfectly.%26nbsp%3B%20If%20the%20same%20script%20is%20used%20at%202nd%20level%20subsite%20its%20works%20for%20all%20values%20of%20the%20list%20except%20any%20that%20are%20managed%20metadata.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20would%20appear%20that%20accessing%20managed%20metadata%20from%20a%20sub%20subsite%20isnt%20working%20with%20my%20code%20-%20any%20idea%20what%20this%20would%20be%20or%20how%20to%20rectify%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-40160%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20Managed%20metadata%20from%20a%20list%20field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-40160%22%20slang%3D%22en-US%22%3E%3CP%3Eyes%20that%20is%20the%20line%20thats%20failing.%26nbsp%3B%20The%20name%20is%20correct%20-%20as%20i%20say%2C%20exactly%20the%20same%20code%20to%20the%20same%20managed%20metadata%20on%20another%20list%20works%20perfectly%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-39911%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20Managed%20metadata%20from%20a%20list%20field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39911%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20looks%20like%20your%26nbsp%3B%3CSTRONG%3EoListItem.get_item('RAG')%20%3C%2FSTRONG%3Eis%20failing.%20Is%20your%20RAG%20field%20a%20list%20column%20or%20a%20site%20column%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20are%20using%20list%20columns%20check%20the%20internal%20names%20(list%20settings%20-%26gt%3B%20column%20-%26gt%3B%20check%20url)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hey - hope someone can help with this before i lose all my hair!  I have a sharepoint list in a top level team site in o365.  In a subsite i have a javascript which pulls a row from the list in the parent site and displays the information on a page - everything works fine!  I then have a same setup on the subsite - the site has a list and the site below that then pulls from the parent site's list and displays on the page.  However, on this site the fields which are management metadata are not working, giving the error:

 

Object doesn't support property or method 'get_label'

 

The oddest thing is that the same managed meta field is used in both lists and the javascripts work identically!  the offending line is:

 

oListItem.get_item('RAG').get_label()

 

Any idea at all what could be going wrong - like i say I have the same code in both scripts and the same managed metadata is used in both lists!

 

Thanks in advance!

3 Replies

It looks like your oListItem.get_item('RAG') is failing. Is your RAG field a list column or a site column?

 

If you are using list columns check the internal names (list settings -> column -> check url)

 

yes that is the line thats failing.  The name is correct - as i say, exactly the same code to the same managed metadata on another list works perfectly

I have made a new discovery.  The script that pulls the information is stored at site collection level.  If the script is used at the 1st level subsite it works perfectly.  If the same script is used at 2nd level subsite its works for all values of the list except any that are managed metadata.

 

It would appear that accessing managed metadata from a sub subsite isnt working with my code - any idea what this would be or how to rectify it?