Salesforce create account error

Failed: Failed and will not be retried

Errors

Exception occurred while performing ‘Create’ operation on identity ‘null’: Url: https://test.sandbox.my.salesforce.com/services/data/v66.0/sobjects/User, Message: 400 : Bad Request : [{“message”:“Required fields are missing: [ProfileId]”,“errorCode”:“REQUIRED_FIELD_MISSING”,“fields”:[“ProfileId”]}], HTTP Error Code: 400


ACCOUNT REQUEST

Create account

ATTRIBUTE REQUESTS

Add ProfileId: 00eQH0000016sMNYAY

Add Email: test@demo.com

Add Username: test@demo.com

Add FirstName: test

Add lastName: demo

Add alias: tdemo

Add TimeZoneSidKey: America/Los_Angeles

Add LocaleSidKey: en_US

Add EmailEncodingKey: UTF-8

Add LanguageLocaleKey: en_US

This is my Account schema:-
{

        "name": "Id",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Id",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "Name",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Name",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "Username",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Username",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "Email",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Email",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "ProfileId",

        "nativeName": null,

        "type": "STRING",

        "schema": {

            "type": "CONNECTOR_SCHEMA",

            "id": "80928509852hkjhkjhskhkj",

            "name": "Profile"

        },

        "description": "ProfileId",

        "isMulti": false,

        "isEntitlement": true,

        "isGroup": true,

        "isManaged": false

    },

    {

        "name": "UserRoleId",

        "nativeName": null,

        "type": "STRING",

        "schema": {

            "type": "CONNECTOR_SCHEMA",

            "id": "2cfecd27eb434836a5cdb76cd0fe08cc",

            "name": "Permissionset"

        },

        "description": "UserRoleId",

        "isMulti": false,

        "isEntitlement": true,

        "isGroup": true,

        "isManaged": false

    },

    {

        "name": "IsActive",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "IsActive",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "UserType",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "UserType",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "LastLoginDate",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "LastLoginDate",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    }

\]

This is my create provisioing policy
{

        "name": "Id",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Id",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "Name",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Name",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "Username",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Username",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "Email",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "Email",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "ProfileId",

        "nativeName": null,

        "type": "STRING",

        "schema": {

            "type": "CONNECTOR_SCHEMA",

            "id": "3e7c04d8fead4e55b6f3c3bb27352102",

            "name": "Profile"

        },

        "description": "ProfileId",

        "isMulti": false,

        "isEntitlement": true,

        "isGroup": true,

        "isManaged": false

    },

    {

        "name": "UserRoleId",

        "nativeName": null,

        "type": "STRING",

        "schema": {

            "type": "CONNECTOR_SCHEMA",

            "id": "2cfecd27eb434836a5cdb76cd0fe08cc",

            "name": "Permissionset"

        },

        "description": "UserRoleId",

        "isMulti": false,

        "isEntitlement": true,

        "isGroup": true,

        "isManaged": false

    },

    {

        "name": "IsActive",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "IsActive",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "UserType",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "UserType",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    },

    {

        "name": "LastLoginDate",

        "nativeName": null,

        "type": "STRING",

        "schema": null,

        "description": "LastLoginDate",

        "isMulti": false,

        "isEntitlement": false,

        "isGroup": false,

        "isManaged": false

    }

\],

Have you checked Salesforce user api spec? It could be that your missing a value in your schema and create account profile. I would review Salesforce’s api specs and see if I was missing something that is required.

https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm

As per your error, It seems some required value that is required for Account Creation is missing. Please check what are the mandatory attributes required for Account Creation and then check your provisioning policy (Create Account).


I test in Bruno it is working.
And these attribute i have passed in request Body.
In sailpoint create account body when instead of passing Plan.ProfileId, i directly passed the profile id it is working

Please share the screenshot of the Create Account page and the JSON for Create Account.

{

"name": "",

"description": null,

"usageType": "CREATE",

"fields": \[

    {

        "name": "Email",

        "transform": {

            "type": "identityAttribute",

            "attributes": {

                "name": "email"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "Username",

        "transform": {

            "type": "identityAttribute",

            "attributes": {

                "name": "email"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "FirstName",

        "transform": {

            "type": "identityAttribute",

            "attributes": {

                "name": "firstname"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "lastName",

        "transform": {

            "type": "identityAttribute",

            "attributes": {

                "name": "lastname"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "alias",

        "transform": {

            "type": "concat",

            "attributes": {

                "values": \[

                    {

                        "type": "substring",

                        "attributes": {

                            "input": {

                                "type": "identityAttribute",

                                "attributes": {

                                    "name": "firstname"

                                }

                            },

                            "begin": 0,

                            "end": 1

                        }

                    },

                    {

                        "type": "substring",

                        "attributes": {

                            "input": {

                                "type": "identityAttribute",

                                "attributes": {

                                    "name": "lastname"

                                }

                            },

                            "begin": 0,

                            "end": 4

                        }

                    }

                \]

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "TimeZoneSidKey",

        "transform": {

            "type": "static",

            "attributes": {

                "value": "America/Los_Angeles"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "ProfileId",

        "transform": {

            "type": "entitlementAttribute",

            "attributes": {

                "name": "ProfileId"

            }

        },

        "attributes": {},

        "isRequired": true,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "LocaleSidKey",

        "transform": {

            "type": "static",

            "attributes": {

                "value": "en_US"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "EmailEncodingKey",

        "transform": {

            "type": "static",

            "attributes": {

                "value": "UTF-8"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    },

    {

        "name": "LanguageLocaleKey",

        "transform": {

            "type": "static",

            "attributes": {

                "value": "en_US"

            }

        },

        "attributes": {},

        "isRequired": false,

        "type": "string",

        "isMultiValued": false

    }

\]

}

In profileID custom transform, you have used a type of entitlementAttribute. Please check if it is returning the correct value.

In Account I am getting this value
ATTRIBUTE REQUESTS

Add ProfileId: 00eQH0000016sMNYAY

Add Email: Test@demo.com

Add Username: Test@demo.com

Add FirstName: Test

Add lastName: account

Add alias: Taccou

Add TimeZoneSidKey: America/Los_Angeles

Add LocaleSidKey: en_US

Add EmailEncodingKey: UTF-8

Add LanguageLocaleKey: en_US

Instead of using a custom transform, just for testing, try to paste a hardcoded value in profileID attribute of Create Account and check if the provisioning is working or not.

{

        "name": "ProfileId",

        "transform": {

            "type": "static",

            "attributes": {

                "value": "00eQH0000016sMXYAY"

            }

        },

        "attributes": {},

        "isRequired": true,

        "type": "string",

        "isMultiValued": false

    },

I hard coded the value still same error

Hi @Ankit17feb

Could you please verify whether the ProfileId is being passed in the provisioning plan? Also, please check the account activity to confirm whether the expected value is being passed.

Hello Ankit, since ProfileID is an entitlement, can you try to remove it from Create Account and try to provision salesforce account using this profile id via access request.

I see in your attribute requests that “alias” is lowercase. Can you attempt to adjust for “Alias”? Alias is another required field and the error may be ambiguous.

Hi…

Can u try with this code

{

“name”: “ProfileId”,

“type”: “STRING”,

“isMulti”: false,

“isEntitlement”: false,

“isGroup”: false

}

Hello Ankit,
I see that ProfileId is defined as isEntitlement: true and isGroup: true in your account schema. With the Web Services connector, that changes how it gets handled during Create Account. By default, the connector strips entitlement attributes out of the Create Account request body and sends them as separate Add Entitlement calls after the account is created. So even though your provisioning plan shows ProfileId with the right value (00eQH0000016sMNYAY), it’s never actually included in the HTTP POST that hits Salesforce. That is why Salesforce returns “Required fields are missing: [ProfileId].”

And that also explains why hardcoding the value as a static transform in the provisioning policy didn’t change anything. The connector decides what to include in the Create Account body based on the schema definition, not based on how the value was generated. If the attribute is flagged as an entitlement, it gets pulled out regardless.

What I would do here is enable createAccountWithEntReq on the source. That tells the connector to merge the entitlement requests into the Create Account call instead of splitting them out. You can turn it on from the UI under your source’s Additional Settings tab, there’s a checkbox called Create Account With “Ent” Request (docs here). Or if you prefer the API route:

[
  {
    "op": "add",
    "path": "/connectorAttributes/createAccountWithEntReq",
    "value": true
  }
]

Once that’s on, $plan.ProfileId$ in your Create Account operation body should resolve correctly.

Also, as Braden pointed out, your provisioning policy: you have alias and lastName, but the Salesforce User API expects Alias and LastName (PascalCase). That’s not causing the current error, but it could trip you up once ProfileId is sorted.

I Removed Profile ID from Create account and it is working fine now

{

        "name": "ProfileId",

        "nativeName": null,

        "type": "STRING",

        "schema": {

            "type": "CONNECTOR_SCHEMA",

            "id": "3e7c04d8fead4e55b6f3c3bb27352102",

            "name": "Profile"

        },

        "description": "ProfileId",

        "isMulti": false,

        "isEntitlement": true,

        "isGroup": true,

        "isManaged": false

    }

I tried this one and it is working now

As Alias is FIrst chaacter of FirstName and 4-5 character of last Name. I think this does not any effect on create account.

I am not Passing the profile value in create account