Customized email update

Hi Team,

I am working on a project, where the requirement to configure logic, if HR adds the email value to the email address attribute in the workday during the new hire record, it must be picked up by AD provisioning and updated that email id to AD’s email attribute, else follow $[email protected] (cloud rule).

Generally, HR keeps the email attribute empty. they update when a new hiring executive wants to use the customized email not the standard which is set up in sAMAccountName attribute(cloud rule)

I have tried to configure transform in create profile for email attribute. now I am not sure what value I should enter in email attribute if I select static?

{
	"name": "email",
	"transform": {
		"attributes": {
			"workEmail": {
				"type": "firstValid",
				"attributes": {
					"values": [{
							"attributes": {
								"name": "Work Email"
							},
							"type": "identityAttribute"
						},
						"NONE"
					]
				}
			},
			"value": "#if($workEmail.contains('NONE'))[email protected]#{else}$workEmail#end"
		},
		"type": "static"
	},
	"attributes": {},
	"isRequired": false,
	"type": "string",
	"isMultiValued": false
}

attaching the screenshot, to know what value should I update there
Screenshot 2022-10-19 at 5.00.50 PM

$[sAMAccountName Came from sAMAccountName attribute

Welcome to the developer community Navneet.

When you apply a custom transform to a Create Account provisioning policy, the account attribute should not have any option selected and it should say “Custom Transform” in the text box.

However, your transform might have some problems. You attempt to reference $sAMAccountName in your static value, but you don’t bring it into the transform. Also, your value doesn’t look correct. Your transform should probably look like this. I haven’t tested it myself, so you’ll need to validate it in your environment.

{
	"name": "email",
	"transform": {
		"attributes": {
			"workEmail": {
				"type": "firstValid",
				"attributes": {
					"values": [{
							"attributes": {
								"name": "Work Email"
							},
							"type": "identityAttribute"
						},
						"NONE"
					]
				}
			},
			"sAMAccountName": {
				"type": "identityAttribute",
				"attributes": {
					"name": "sAMAccountName"
				}
			},
			"value": "#if($workEmail=='NONE')${sAMAccountName}@ringcentral.com#{else}$workEmail#end"
		},
		"type": "static"
	},
	"attributes": {},
	"isRequired": false,
	"type": "string",
	"isMultiValued": false
}

For Create Account (Provisioning Policy) you can reference sAMAccountName utilizing $sAMAccountName , please note that sAMAccountName must come before mail in the create account order.