cancel
Showing results for 
Search instead for 
Did you mean: 

Get logged in user data in SAP Work Zone

1,636

Hi I am currently working on a Card in SAP Work Zone that should display the current logged in user. Is there a way to get the logged in user data from SAP Work Zone and add it in the Card?

View Entire Topic
muzammo
Explorer

In any controller Init function you can call below code : 

 

this.getOwnerComponent().oComponentData._sapUiIntegration_card.getHostInstance().getContextValue("sap.workzone/currentUser/email").then(function(value){console.log(value)})

apologies for any typo. 

sladerose
Explorer
0 Kudos
Hi Muzammo, I am trying to fetch the logged in user email on SAP Build Work Zone Advanced Edition. I want to use this value to display inside a UI integration card, and to filter data inside the card. I am having some difficult implementing your code. Could you please assist me? I am happy to share my project with you?