SP-PNP-JS: trying to get the value of SPS-MUILAnguages

%3CLINGO-SUB%20id%3D%22lingo-sub-195493%22%20slang%3D%22en-US%22%3ESP-PNP-JS%3A%20trying%20to%20get%20the%20value%20of%20SPS-MUILAnguages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-195493%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20SP-PNP-js%20to%20get%20the%20properties%20of%20the%20user.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wrote%20a%20for-each%20that%20get%20all%20properties%20and%20I%20am%20interested%20in%20one%20of%20them%3A%20SPS-MUILanguages.%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20try%20to%20get%20the%20value%20of%20that%20property%20I%20get%20this%20error%20in%20VS%20Code%3A%26nbsp%3B%3C%2FP%3E%3CPRE%3EType%20'number'%20is%20not%20assignable%20to%20type%20'string'.%3CBR%20%2F%3ECannot%20find%20name%20'MUILanguages'%3C%2FPRE%3E%3CP%3EAnd%20this%20is%20how%20I%20am%20trying%20to%20get%20the%20value%3A%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3Edocument%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EgetElementById%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22spUserProfileProperties%22%3C%2FSPAN%3E%3CSPAN%3E).%3C%2FSPAN%3E%3CSPAN%3EinnerHTML%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EuserProperties%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3ESPS%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EMUILanguages%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EValue%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20get%20the%20language%20value%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EAmerico%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Highlighted
Regular Contributor

Hi,

 

I am using SP-PNP-js to get the properties of the user. 

I wrote a for-each that get all properties and I am interested in one of them: SPS-MUILanguages. 

When I try to get the value of that property I get this error in VS Code: 

Type 'number' is not assignable to type 'string'.
Cannot find name 'MUILanguages'

And this is how I am trying to get the value: 

document.getElementById("spUserProfileProperties").innerHTML = userProperties.SPS-MUILanguages.Value;

 

How can I get the language value? 

 

Best regards

Americo

0 Replies