Passing null value in provisioning plan

How can we pass a null value in the provisioning policy? During the disable operation, I need to set certain attributes to null. I tried updating the attribute values as null in the provisioning policy, but it isn’t reflecting in the field. Even passing an empty string doesn’t seem to work. Has anyone faced this issue, and how did you resolve it?

@shruthi_m you can use below code in your beforProvisioning rule, you can first check the operation is disable and then set the attributes as per your requirement.

AttributeRequest clearEmployeeNumber  = new AttributeRequest("employeeNumber", ProvisioningPlan.Operation.Set, "");
srcAcctRequest.add(clearEmployeeNumber);

Before Provisioning Rule | SailPoint Developer Community

Please use beforeProvision rule to set null as suggested by @shekhardas1825 . In case if it is a web service connector(as you have tagged in post), I believe same can be achieved by beforeOperation rule to create a json body with null values.

Hi @shruthi_m ,

As @shekhardas1825 mentioned, you can use that code in before provisioning rule to set the value as empty.
Also you can set an object variable as null for eg.(Object newValue = null;) and then use that variable inside the attribute request like (accountRequest.add(new AttributeRequest(attribute name, ProvisioningPlan.Operation.Set, newValue));
)

Thanks

Sorry, I want pass null value in Provisioning policy.

The issue was resolved by Before operation rule.

import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;
import connector.common.JsonUtil;
import sailpoint.connector.webservices.EndPoint;

Map body = requestEndPoint.getBody();

if (body != null && body.containsKey("jsonBody")) {
    try {
        String jsonBody = (String) body.get("jsonBody");
        Map jsonResponse = JsonUtil.toMap(jsonBody);
        ArrayList usersList = (ArrayList) jsonResponse.get("users");
        for (Map user : usersList) {
            user.put("job_title", ""); 
        }
        String updatedJsonBody = JsonUtil.render(jsonResponse);
        body.put("jsonBody", updatedJsonBody);
        requestEndPoint.setBody(body);

    } catch (Exception e) {
        
    }
}
return requestEndPoint;

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.