I created a quick link that includes a workflow. In one of the workflow steps, there’s a form with multiple fields. I need to set the value of a specific field based on the value of another field within the same form.
Is there a way to write a rule for this field to dynamically assign its value depending on the other field? If so, how can I do it?
if I understand your requirement correctly then you have to configure the first field to contain “postback=true” and add a value script to the second field (which is dependent) like in the following example:
You need to make sure your first field on which the value of second field is depended is set postBack=“true” and the second field is set with dynamic=“true”. Here is a sample
<Field name="userType" postBack="true" required="true" type="string">
<AllowedValues>
<String>User Type A</String>
<String>User Type B</String>
<String>User Type C</String>
<String>User Type D</String>
</AllowedValues>
</Field>
<Field dynamic="true" name="secondField" readOnly="true" type="string">
<Script>
<Source>
if(userType != null){
if(userType.equalsIgnoreCase("User Type A")){
return "A";
}
if(userType.equalsIgnoreCase("User Type B")){
return "B";
}
if(userType.equalsIgnoreCase("User Type C")){
return "C";
}
if(userType.equalsIgnoreCase("User Type D")){
return "D";
}
}
</Source>
</Script>
</Field>
i tried your code but i have a problem: the fied: managerForm is of type sailpoint.object.Identity, but when i try to cast it to identity in the script of the other field like this picture, it gives me an exception: “Cannot cast java.lang.String to sailpoint.object.Identity BSF info: script at line: 0 column: columnNo”, although the field “managerForm” is of type identity not string.
Hi Lojain,
The Identity type field returns Identity id and not Identity object. You can use something like the following to get the actual identity object using the id value