How to write provisioning form rule for SCIM 2.0 connector for complex attribute emails.value

Payload for user creation is as follow


{
“schemas”: [
“urn:ietf:params:scim:schemas:core:2.0:User”,
“urn:ietf:params:scim:schemas:extension:enterprise:2.0:User”
],
“externalId”: “0a21f0f2-8d2a-4f8e-bf98-7363c4aed4ef”,
“userName”: “[email protected]”,
“displayName”: “Test User”,
“active”: true,
“emails”: [
{
“primary”: true,
“type”: “work”,
“value”: “[email protected]
}
],
“meta”: {
“resourceType”: “User”
},
“name”: {
“formatted”: “givenName familyName”,
“familyName”: “Test”,
“givenName”: “User”
},
“roles”:
}

How to add complex attribute like emails.value in provisioning form
Below is my provisioning form

 <ProvisioningForms>
    <Form name="Create" objectType="account" type="Create">
      <Attributes>
        <Map>
          <entry key="pageTitle" value="Create"/>
        </Map>
      </Attributes>
      <Section name="Section 1">
        <Field displayName="userName" name="userName" type="string">
          <Script>
            <Source>
              
                return identity.getDisplayName()+"@xx.com";
              
            </Source>
          </Script>
        </Field>
        <Field displayName="active" name="active" type="string">
          <Script>
            <Source>
              
                return "true";
              
            </Source>
          </Script>
        </Field>
        <Field displayName="FirstName" name="name.givenName" type="string">
          <Script>
            <Source>
              
                return identity.getFirstname();
              
            </Source>
          </Script>
        </Field>
        <Field displayName="Lastname" name="name.familyName" type="string">
          <Script>
            <Source>
              
                return identity.getLastname();
              
            </Source>
          </Script>
        </Field>
        <Field displayName="Email" name="emails.value" type="string">
          <Script>
            <Source>
              
                return identity.getDisplayName()+"@xx.com";
              
            </Source>
          </Script>
        </Field>
        <Field displayName="Email.type" name="emails.type" type="string">
          <Script>
            <Source>
              
                return "work";
              
            </Source>
          </Script>
        </Field>
        <Field displayName="Email.primary" name="emails.primary" type="boolean" value="true"/>
      </Section>
    </Form>
  </ProvisioningForms>

I am getting below error
java.io.IOException: {“schemas”:[“urn:ietf:params:scim:api:messages:2.0:Error”],“scimType”:“Input payload error”,“detail”:“Primary Email is required\n”,“status”:“400”}

you dont do it into the prov. form. Into the form you prepare the values, nothing else.

Later you can manage those value with a before op. rule or directly into the body like this:

“emails”: [
{
“primary”: "$plan.emailPrimary$",
“type”: “ $plan.emailType$”,
“value”: “ $plan.emailValue$”
}

PS change the names of the fields

Hi @enistri_devo ,
Thanks for you message.
But unfortunately, I am using SCIM 2.0 direct connector and there is no before op rule available

so you dont have this problem, put in the form the same name that you have into the schema

yes, @enistri_devo I used schema field name in provisioning name and then I am getting below error :
java.io.IOException: {“schemas”:[“urn:ietf:params:scim:api:messages:2.0:Error”],“scimType”:“Input payload error”,“detail”:“Primary Email is required\n”,“status”:“400”}

you are not sending an attribute called “Primary Email” that its which is different from email attribute. Can you see the schema of a wellformed user?

Also, you can activate the logs of SCIM connector and keep more info.