Web services connector and payload craft with null values

Dear colleagues,

I’d like to borrow your insight, on the details of the Web Services connector.
The documentation states the following

  • If the body contains a placeholder that is not present in the provisioning plan, response, or source, the source removes the key value from the JSON payload. For example,

    {
        "type": "$plan.type$",
        "id": "$plan.nativeIdentity$",
        "title": "$plan.title$",
        "externalid": "12345"
    }
    

    If the plan does not contain the title attribute request, the source will remove the title key and value. For example,

    {
        "type": "student",
        "id": "STUD121",
        "externalid": "12345"
    }
    

    However, in my connector I experience something different. It is set up like this:
    {
    …some other data..

    “firstName”: “$plan.firstName$”,
    “lastName”: “$plan.lastName$”,
    “organizationCode”: “$plan.organizationCode$”,

    … etc.
    }
    For those users without an Organization Code in the identity cube, it seems to craft a payload with an EMPTY attribute, rather than no attribute.
    So, it seems to produce this:
    {

    “firstName”: “Donald”,
    “lastName”: “Duck”,
    “organizationCode”: “”

    }
    Instead of this

    {

    “firstName”: “Donald”,
    “lastName”: “Duck”

    }

    Do you know why this might happen? do you have a similar experience?
    Before you ask: the connector is associated to a before Provisioning Rule, but it doesn’t kick in for Create Account operations, and it does not add this attribute in this case.

    Thank you
    Fabio Carraro

I noticed something similar recently, I’m wondering if there was a change/update with the connector. Are you still experiencing the same behavior?

Hi @fabio_carraro

You’re seeing: “organizationCode”: " "when there is no org code, because ISC is still including the field (usually as an empty string) instead of omitting it.

Why it happens

  1. Your CreateAccount body is set to Form Data → Form Data can still send key/value pairs even when entries are empty.

  2. organizationCode is still present in the provisioning plan as an empty string (“”)

The fix

  • Change the CreateAccount request body type to Raw JSON (not Form Data).

  • Keep organizationCode as a $plan…$ placeholder.

With Raw JSON, ISC will drop the key/value when the attribute is not present in the provisioning plan (documented behavior). Also make sure you’re not defaulting organizationCode to “” in the provisioning policy/mapping.

If you need “omit even when present-but-blank”

There’s no built-in conditional template syntax for that. The deterministic approach is a Web Services Before Operation Rule to remove keys whose values are empty before the request is sent (runs on the VA).

Please also check (SailPoint documentation for this it may give more insights as well

  • Web Services connector “Body” (Form Data empty behavior + Raw JSON placeholder omission behavior):
    Body

  • Web Services connector “Before Operation Rule” (payload adjustment hook):
    Web Services Before Operation Rule

If that solve your issue

Please mark it as solution :blush: