cancel
Showing results for 
Search instead for 
Did you mean: 

Get logged in user data in SAP Work Zone

1,670

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
stippi
Advisor
Advisor

Yes. If you have the card instance, you can call getHostInstance() on it to obtain context information in Work Zone:

card.getHostInstance().getContextValue("sap.workzone/currentUser")

Note that this returns a Promise. See https://help.sap.com/docs/WZ/7d3b9c7211ca4d7a9630b524205ee836/e69aef3fb6f448d084ce601ebf4555da.html?... for more information. Also the documentation for getContextValue(): https://ui5.sap.com/#/api/sap.ui.integration.Host%23methods/getContextValue

JBrook
Explorer
0 Kudos

Where do you call this function? In the configuration.js?

JBrook
Explorer
0 Kudos

There's just the /dt/configuration.js file..

Designtime configuration file.

sladerose
Explorer
0 Kudos
Hi Stippi, could you explain how I do this in a UI integration card deployed on Build Work Zone?