Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Create account JSON parsing error

saurabhp
New Contributor
New Contributor

Hi,

We are facing "JSON_PARSER_ERROR"}],"statusCode":400," issue in follwing JSON. Kindly lets us know if Task object and dynamic attribute is available in create JSON ?

{
"accountIdPath": "call1.message.id",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://removed.sandbox.my.salesforce.com/services/data/v48.0/sobjects/Contact ",
"httpMethod": "POST",
"httpParams": "{\"FirstName\":\"${user?.getFirstname()}\",\"LastName\":\"${user?.getLastname()}\",\"HN_Contact_Type__c\":\"Dealer Contact\",\"Salutation\":\"${user?.getCustomproperty1()}\",\"Department\":\"${user?.getDepartmentname()}\",\"Email\":\"${user?.getEmail()}\",\"HN_Position__c\":\"${user?.getTitle()}\",\"MobilePhone\":\"${user?.getPhonenumber()}\",\"HN_Home_Phone__c\":\"${user.secondaryPhone}\",\"HN_TDTENO__c\":\"${task.source=='REQUEST'?requestAccessAttributes.get('techno'):user?.getUsername()}\",\"HN_ERP_ID__c\":\"${task.source=='REQUEST'?D_user?.getUsername():D_user?.getUsername()}'\",\"HN_Active__c\":true,\"AccountId\":\"${user.getCustomproperty6()==('33333')?'0011e00000lpMAFAA2':(user.getCustomproperty6()==('80630')?'0011e00000gFx7gAAC':(user.getCustomproperty6()==('80544')?'0011e00000cUQwIAAW':(user.getCustomproperty6()==('22550')?'0011e00000SqLVBAA3':(user.getCustomproperty6()==('80254')?'0011e00000S33CkAAJ':(user.getCustomproperty6()==('80250')?'0011e00000S33CjAAJ':(user.getCustomproperty6()==('80220')?'0011e00000S33CiAAJ':(user.getCustomproperty6()==('80266')?'0011e00000S33ChAAJ':(user.getCustomproperty6()==('80119')?'0011e00000S33CgAAJ':(user.getCustomproperty6()==('80086')?'0011e00000S33CfAAJ':(user.getCustomproperty6()==('80076')?'0011e00000S33CeAAJ':(user.getCustomproperty6()==('80060')?'0011e00000S33CdAAJ':(user.getCustomproperty6()==('80052')?'0011e00000S33CcAAJ':(user.getCustomproperty6()==('80048')?'0011e00000S33CbAAJ':(user.getCustomproperty6()==('80044')?'0011e00000S33CaAAJ':(user.getCustomproperty6()==('80042')?'0011e00000S33CZAAZ':(user.getCustomproperty6()==('8062')?'0011e00000S33CYAAZ':(user.getCustomproperty6()==('80019')?'0011e00000S33CXAAZ':(user.getCustomproperty6()==('79300')?'0011e00000S33CWAAZ':(user.getCustomproperty6()==('75000')?'0011e00000S33CVAAZ':(user.getCustomproperty6()==('74444')?'0011e00000S33CUAAZ':(user.getCustomproperty6()==('74400')?'0011e00000S33CTAAZ':(user.getCustomproperty6()==('74000')?'0011e00000S33CSAAZ':(user.getCustomproperty6()==('73500')?'0011e00000S33CRAAZ':'0011e00000lpMAFAA2')))))))))))))))))))))))}\",\"HN_Start_Date__c\":\"${(new Date()).format('yyyy-MM-dd',TimeZone.getTimeZone('AEDT'))}\",\"HN_End_Date__c\":\"2099-12-31\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
],
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500
]
}
}
}
]
}

[This message has been edited by moderator to mask Url]

6 REPLIES 6

rushikeshvartak
All-Star
All-Star

use "arsTasks" 

rushikeshvartak_0-1707926625460.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Thanks!! arstasks object works but still it gives json parser error for below JSON i believe it is giving for line where we are trying to conctenate D_
Is there anyway to concatenate D 

{
    "accountIdPath": "call1.message.id",
    "call": [
        {
            "name": "call1",
            "connection": "userAuth",
            "httpMethod": "POST",
            "httpParams": "{\"FirstName\":\"${user?.getFirstname()}\",\"LastName\":\"${user?.getLastname()}\",\"HN_Contact_Type__c\":\"Dealer Contact\",\"Salutation\":\"${user?.getCustomproperty1()}\",\"Department\":\"${user?.getDepartmentname()}\",\"Email\":\"${user?.getEmail()}\",\"HN_Position__c\":\"${user?.getTitle()}\",\"MobilePhone\":\"${user?.getPhonenumber()}\",\"HN_Home_Phone__c\":\"${user.secondaryPhone}\",\"HN_TDTENO__c\":\"${if(arsTasks.source=='REQUEST'){requestAccessAttributes.get('techno')}else{user?.getUsername()}}\",\"HN_ERP_ID__c\":\"${if(arsTasks.source=='REQUEST')D_{requestAccessAttributes.get('techno')}else D_{user?.getUsername()}}\",\"HN_Active__c\":true,\"AccountId\":\"${user.getCustomproperty6()==('33333')?'0011e00000lpMAFAA2':(user.getCustomproperty6()==('80630')?'0011e00000gFx7gAAC':(user.getCustomproperty6()==('80544')?'0011e00000cUQwIAAW':(user.getCustomproperty6()==('22550')?'0011e00000SqLVBAA3':(user.getCustomproperty6()==('80254')?'0011e00000S33CkAAJ':(user.getCustomproperty6()==('80250')?'0011e00000S33CjAAJ':(user.getCustomproperty6()==('80220')?'0011e00000S33CiAAJ':(user.getCustomproperty6()==('80266')?'0011e00000S33ChAAJ':(user.getCustomproperty6()==('80119')?'0011e00000S33CgAAJ':(user.getCustomproperty6()==('80086')?'0011e00000S33CfAAJ':(user.getCustomproperty6()==('80076')?'0011e00000S33CeAAJ':(user.getCustomproperty6()==('80060')?'0011e00000S33CdAAJ':(user.getCustomproperty6()==('80052')?'0011e00000S33CcAAJ':(user.getCustomproperty6()==('80048')?'0011e00000S33CbAAJ':(user.getCustomproperty6()==('80044')?'0011e00000S33CaAAJ':(user.getCustomproperty6()==('80042')?'0011e00000S33CZAAZ':(user.getCustomproperty6()==('8062')?'0011e00000S33CYAAZ':(user.getCustomproperty6()==('80019')?'0011e00000S33CXAAZ':(user.getCustomproperty6()==('79300')?'0011e00000S33CWAAZ':(user.getCustomproperty6()==('75000')?'0011e00000S33CVAAZ':(user.getCustomproperty6()==('74444')?'0011e00000S33CUAAZ':(user.getCustomproperty6()==('74400')?'0011e00000S33CTAAZ':(user.getCustomproperty6()==('74000')?'0011e00000S33CSAAZ':(user.getCustomproperty6()==('73500')?'0011e00000S33CRAAZ':'0011e00000lpMAFAA2')))))))))))))))))))))))}\",\"HN_Start_Date__c\":\"${(new Date()).format('yyyy-MM-dd',TimeZone.getTimeZone('AEDT'))}\",\"HN_End_Date__c\":\"2099-12-31\"}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    201
                ],
                "unsuccessResponses": {
                    "statusCode": [
                        400,
                        401,
                        404,
                        405,
                        500
                    ]
                }
            }
        }
    ]
}
[This message has been edited by moderator to mask URL]

Spoiler
{
"accountIdPath": "call1.message.id",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://honda--flqa.sandbox.my.salesforce.com/services/data/v48.0/sobjects/Contact",
"httpMethod": "POST",
"httpParams": "{\"FirstName\":\"${user?.firstname}\",\"LastName\":\"${user?.lastname}\",\"HN_Contact_Type__c\":\"Dealer Contact\",\"Salutation\":\"${user?.customproperty1}\",\"Department\":\"${user?.departmentname}\",\"Email\":\"${user?.email}\",\"HN_Position__c\":\"${user?.title}\",\"MobilePhone\":\"${user?.phonenumber}\",\"HN_Home_Phone__c\":\"${user.secondaryphone}\",\"HN_TDTENO__c\":\"${if(arsTasks.source=='REQUEST'){requestAccessAttributes.get('techno')}else{user?.username}}\",\"HN_ERP_ID__c\":\"${if(arsTasks.source=='REQUEST')D_{requestAccessAttributes.get('techno')}else D_{user?.username}}\",\"HN_Active__c\":true,\"AccountId\":\"${user.customproperty6==('33333')?'0011e00000lpMAFAA2':(user.customproperty6==('80630')?'0011e00000gFx7gAAC':(user.customproperty6==('80544')?'0011e00000cUQwIAAW':(user.customproperty6==('22550')?'0011e00000SqLVBAA3':(user.customproperty6==('80254')?'0011e00000S33CkAAJ':(user.customproperty6==('80250')?'0011e00000S33CjAAJ':(user.customproperty6==('80220')?'0011e00000S33CiAAJ':(user.customproperty6==('80266')?'0011e00000S33ChAAJ':(user.customproperty6==('80119')?'0011e00000S33CgAAJ':(user.customproperty6==('80086')?'0011e00000S33CfAAJ':(user.customproperty6==('80076')?'0011e00000S33CeAAJ':(user.customproperty6==('80060')?'0011e00000S33CdAAJ':(user.customproperty6==('80052')?'0011e00000S33CcAAJ':(user.customproperty6==('80048')?'0011e00000S33CbAAJ':(user.customproperty6==('80044')?'0011e00000S33CaAAJ':(user.customproperty6==('80042')?'0011e00000S33CZAAZ':(user.customproperty6==('8062')?'0011e00000S33CYAAZ':(user.customproperty6==('80019')?'0011e00000S33CXAAZ':(user.customproperty6==('79300')?'0011e00000S33CWAAZ':(user.customproperty6==('75000')?'0011e00000S33CVAAZ':(user.customproperty6==('74444')?'0011e00000S33CUAAZ':(user.customproperty6==('74400')?'0011e00000S33CTAAZ':(user.customproperty6==('74000')?'0011e00000S33CSAAZ':(user.customproperty6==('73500')?'0011e00000S33CRAAZ':'0011e00000lpMAFAA2')))))))))))))))))))))))}\",\"HN_Start_Date__c\":\"${(new Date()).format('yyyy-MM-dd',TimeZone.TimeZone('AEDT'))}\",\"HN_End_Date__c\":\"2099-12-31\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
],
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500
]
}
}
}
]
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

HI Rushikesh,

Can you suggest how to concatenate D_ in above json mnetioned in comments

${if(arsTasks.source=='REQUEST') { 'D_' + requestAccessAttributes.get('techno'){ else {'D_' + (user?.username)}}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Vedanth-BK
Regular Contributor
Regular Contributor

Hi @saurabhp 

The binding variables are incorrect ..
example
please use ${user.firstname} instead of  ${user?.getFirstname()} the same goes with all the binding varibale provided in the httpParams

Thank you
Vedanth B.K