Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Provisioning into SAP Successfactor

snafissatou1
New Contributor
New Contributor

Hello team,

I'm trying to provision the birthofDate attribute into SAP Successfactor from saviynt. I tried following syntaxes but none of them worked:

1- \"dateOfBirth\":\"${new SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2).toInstant().toEpochMilli()}\"

2- \"dateOfBirth\":\"${user.customproperty2==null?null: '\"Date('+(new java.text.SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2)).toInstant().toEpochMilli()+')\"'}\",

3-  \"dateOfBirth\":\"${null!=user.customproperty2?'/Date('+new Date(user.customproperty2)..toEpochMilli()+')/':null}\",

The different error messages displayed are:

 {
            "headers":null,
            "message":{
               "error":{
                  "code":"BadRequestException",
                  "message":{
                     "lang":"en-US",
                     "value":"Property dateOfBirth has invalid value. Illegal DateTime value in JSON format: ${user.customproperty2.toInstant().toEpochMilli()}. Please follow the standard format: \"/Date(<ticks>)/\", <ticks> = number of milliseconds since midnight Jan 1, 1970. Example: \"/Date(1495746637000)/\". For more information, see https://help.sap.com/viewer/d599f15995d348a1b45ba5603e2aba9b/latest/en-US/971f5829b7aa4c9fab04c12f06...., required type is Edm.DateTime."
                  }
               }
            },
            "statusCode":400,
            "description":null,
            "status":"Failed"
         },
         {
            "headers":null,
            "message":{
               "error":{
                  "code":"BadRequestException",
                  "message":{
                     "lang":"en-US",
                     "value":"Property dateOfBirth has invalid value. Illegal DateTime value in JSON format: ${new java.text.SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2).toInstant().toEpochMilli()}. Please follow the standard format: \"/Date(<ticks>)/\", <ticks> = number of milliseconds since midnight Jan 1, 1970. Example: \"/Date(1495746637000)/\". For more information, see https://help.sap.com/viewer/d599f15995d348a1b45ba5603e2aba9b/latest/en-US/971f5829b7aa4c9fab04c12f06...., required type is Edm.DateTime."
                  }
               }
            },
            "statusCode":400,
            "description":null,
            "status":"Failed"
         },
         {
            "headers":null,
            "message":{
               "error":{
                  "code":"BadRequestException",
                  "message":{
                     "lang":"en-US",
                     "value":"Property dateOfBirth has invalid value. Illegal DateTime value in JSON format: '/Date('+${new java.text.SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2).toInstant().toEpochMilli()}+')/'. Please follow the standard format: \"/Date(<ticks>)/\", <ticks> = number of milliseconds since midnight Jan 1, 1970. Example: \"/Date(1495746637000)/\". For more information, see https://help.sap.com/viewer/d599f15995d348a1b45ba5603e2aba9b/latest/en-US/971f5829b7aa4c9fab04c12f06...., required type is Edm.DateTime."
                  }
               }
            },
            "statusCode":400,
            "description":null,
            "status":"Failed"
         }
 
You will find below the createaccountJson:
{
   "accountIdPath": "call1.message.d.userId",
   "call":[
      {
         "showlog":"true",
         "name":"call1",
         "connection":"userAuth",
         "url":"xxx",
         "httpMethod":"POST",
         "httpContentType":"application/json",
         "httpParams":"{\"userId\":\"${user.username!=null?user.username:''}\",\"username\":\"${user.username!=null?user.username:''}\",\"firstName\":\"${user.firstname!=null?user.firstname:''}\",\"lastName\":\"${user.lastname!=null?user.lastname:''}\",\"CUSTOM_IS_MANAGER\":\"${user.customproperty51!=null?user.customproperty51:''}\",\"dateOfBirth\":\"/Date(${new java.text.SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2).toInstant().toEpochMilli()})/\",\"status\":\"${user.statuskey==null?'':user.statuskey==1?'t':''}\"}",
         "httpHeaders":{
            "Authorization":"${access_token}",
            "Accept":"application/json"
         },
        "successResponses": {
        "statusCode": [
         200,
         201
      ]
      },
         "unsuccessResponses": {
            "statusCode": [
               400,
               401,
               405,
               403,
               500
            ]
      }
      }
   
   ]
}
 
Could some has the correct syntax for the date attribute while provisioning?
Thank you for your help

[This message has been edited by moderator to disable url hyperlink with sensitive info]

5 REPLIES 5

rushikeshvartak
All-Star
All-Star
{
   "accountIdPath": "call1.message.d.userId",
   "call":[
      {
         "showlog":"true",
         "name":"call1",
         "connection":"userAuth",
         "url":"https://xxv2/User",
         "httpMethod":"POST",
         "httpContentType":"application/json",
         "httpParams":"{\"userId\":\"${user.username!=null?user.username:''}\",\"username\":\"${user.username!=null?user.username:''}\",\"firstName\":\"${user.firstname!=null?user.firstname:''}\",\"lastName\":\"${user.lastname!=null?user.lastname:''}\",\"CUSTOM_IS_MANAGER\":\"${user.customproperty51!=null?user.customproperty51:''}\",\"dateOfBirth\":\"${user.customproperty2!=null?'/Date('+new Date(java.text.SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2).getTime())+')/':null}\",\"status\":\"${user.statuskey==null?'':user.statuskey==1?'t':''}\"}",
         "httpHeaders":{
            "Authorization":"${access_token}",
            "Accept":"application/json"
         },
        "successResponses": {
        "statusCode": [
         200,
         201
      ]
      },
         "unsuccessResponses": {
            "statusCode": [
               400,
               401,
               405,
               403,
               500
            ]
      }
      }
   
   ]
}

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hello  rushikeshvartak,

It's not worked, the error message displayed below:

 

 "call1":{
      "headers":null,
      "message":{
         "error":{
            "code":"BadRequestException",
            "message":{
               "lang":"en-US",
               "value":"Property dateOfBirth has invalid value. Illegal DateTime value in JSON format: ${user.customproperty2!=null?'/Date('+new Date(java.text.SimpleDateFormat('yyyy-MM-dd').parse(user.customproperty2).getTime())+')/':null}. Please follow the standard format: \"/Date(<ticks>)/\", <ticks> = number of milliseconds since midnight Jan 1, 1970. Example: \"/Date(1495746637000)/\". For more information, see https://help.sap.com/viewer/d599f15995d348a1b45ba5603e2aba9b/latest/en-US/971f5829b7aa4c9fab04c12f06...., required type is Edm.DateTime."
            }
         }
      },
      "statusCode":400,
      "description":null,
      "status":"Failed"
   }

Does hardcoded DoB is working from saviytn ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Yes it's working.

Vedanth-BK
Regular Contributor
Regular Contributor

Hello @snafissatou1 


Add {"showLogs": true} in Config json  
Run the prov job 
Check the debug logs with the keyword showlogs  to see what is getting passed in the httpParams.



Thank you
Vedanth B.K
If you find my response helpful and it works, Hit the 'Kudos' button and accept it as a solution!!