Web Services SaaS Connector Create Operation - Update request body

Hi, I am using Web Services SaaS connector for create operation in the application. My input request body looks like as this

{
    "emails": [
        {
            "value": "test_enduser@xyz.com",
            "primary": true
        }
    ],
    "displayName": "test_enduser@xyz.com",
    "name": {
        "givenName": "Test",
        "familyName": "EndUser"
    },
    "active": "active",
    "userName": "test_enduser@xyz.com",
    "schemas": [
        "xxxxxx"
    ]
}

My requirement is to check the active state and if it is active convert into true else false. I am trying to use Before Provisioning Rule for this. But I am not seeing a suitable example to get the requested json body and update a variable in the body. In VA version of Web Service connector, we could get json body from requestEndPoint.
Can any of you point me to any example of Before Provisioning Rule which I can refer to get json body from plan and update it.
Thanks
Mathew

1 Like

You do not need Rule for this.

You need to configure Create Account Provisioning Policy form, have an attribute active, use Transform to calculate the value either static or lookup is fine.

In your body, you can reference it as $plan.active$

Thanks for the input, our application logic is a little more complex as different variables are checked to disable a target account. For this application the logic is, a user will be disabled if lifecycle status is inactive or not in a list of countries but not in the exception list of users. So thought using BeforeProvisioning rule as recommended.

Trying to understand the structure of provisioning plan object and how to get the request body, so that can have logic based on input values in create and update operations to update the request body.
Thanks
Mathew

If you wanna use BP Rule that is fine, but most of the complex scenarios can be fulfilled by using Transforms itself.

It is very simple, you need to have create account provisioning policy form where you will have all attributes (with necessary mappings and Transforms) you need to create account, you can reference those attributes in your HTTP operation body using expression $plan.attributeName$

{
"name": "$plan.name",
"email": "$plan.email$"
}
1 Like

@KRM7 Looks like account provisioning policy is simple. Can you please share a sample account provisioning policy code snippet with transformation to start with?
Thanks
Mathew

Here you go

{
    "name": "Account",
    "description": null,
    "usageType": "CREATE",
    "fields": [
        {
            "name": "status",
            "transform": {
                "type": "static",
                "attributes": {
                    "value": "Active"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "email",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "email"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "givenName",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "firstname"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "familyName",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "lastname"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "displayName",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                       {
                           "type": "identityAttribute",
                           "attributes": {
                               "name": "firstname"
                           }
                       },
                       {
                           "type": "identityAttribute",
                           "attributes": {
                               "name": "lastname"
                           }
                       }
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        }
    ]
}
1 Like

Thank you so much @KRM7
Regards
Mathew

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