Get User Property in ScreenContext using JavaScript

Document ID : KB000115957
Last Modified Date : 27/09/2018
Show Technical Document Details
Question:
We usually define environment variables which we can reuse in BLTH/EventListeners/ParticipantResolvers as User Defined Properties in environment definition
(IDM management console > Home > Environments > ENV > Advanced Settings > Miscellaneous).
Then we load those variables in java class body in init method and use it. Now have similar need when initializing Task Screen Profile Field, but I cannot find the way how to load the variable. Is it even possible to do it in java script?
Answer:
function init(FieldContext)
{
 var Property_Value = FieldContext.getEnvironmentSettingsProvider().getEnvironmentUserDefinedPropertiesDefinition().getUserProperties().get("MY_USER_DEFINED_PROPERTY");
 ...
}