Servicenow data action to pull VIP status

Hi All

Im pretty new to genesys and trying to work my way around pulling some additional data via a service now data action in particular jut the VIP portion to be able to route via architect

Input Contract:

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Developer ServiceNow",
"description": "Test Action for Developer ServiceNow. Find UserID record based on mobile_phone field",
"type": "object",
"required": [
"PHONE_NUMBER"
],
"properties": {
"PHONE_NUMBER": {
"description": "CustomLookUpValue",
"type": "string"
}
},
"additionalProperties": true
}

Output contract:

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "result",
"description": "Service Now Response. UserID",
"type": "object",
"properties": {
"VIP": {
"type": "boolean"
}
},
"additionalProperties": true
}

RESPONSE:

{
"translationMap": {
"contact": "$result"
},
"translationMapDefaults": {
"contact": ""result""
},
"successTemplate": ""$vip" : "true",\n "
}

RESULT FROM EXECUTE:

{
"result": [
{
"calendar_integration": "1",
"last_login_time": "",
"failed_attempts": "",
"user_name": "EN10005891",
"source": "",
"title": "",
"building": "",
"sys_class_name": "customer_contact",
"web_service_access_only": "false",
"sys_id": "dbb2f2f7870b3050a7eac9570cbb357c",
"enable_multifactor_authn": "false",
"sys_updated_by": "David.Ragon@Ethan.com.au",
"internal_integration_user": "false",
"sso_source": "",
"mobile_phone": "+61451237863",
"sys_domain": {
"link": "https://ethantest.service-now.com/api/now/table/sys_user_group/global",
"value": "global"
},
"department": "",
"u_type": "",
"vip": "true",
"first_name": "David",
"email": "David.Ragon@xyz.com",
"introduction": "",
"preferred_language": "en",
"sys_created_by": "archit.b",
"home_phone": "",
"time_format": "",
"manager": "",
"sys_mod_count": "4",
"last_name": "Ragon",
"avatar": "",
"sys_domain_path": "/",
"sys_tags": "",
"time_zone": "",
"schedule": "",
"cost_center": "",
"phone": "+61286045509",
"name": "David Ragon",
"employee_number": "",
"date_format": "",
"location": ""
}
]
}

APPLY OUTPUT ERROR:

{
"message": "Transform failed to process result using 'successTemplate' template due to error:'Variable $vip has not been set at successTemplate[line 1, column 2]'\n Template:'"$vip" : "true",\n '.",
"code": "bad.request",
"status": 400,
"messageParams": {},
"contextId": "b869d885-34b8-4fad-b349-9b04886fa407",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": []
}

Any help would be appreciated thanks all!!!!

In your success template you should change the
$vip
to
VIP

I believe that this is case sensitive, so the VIP needs to match your output contract. The $ indicates to velocity that you are trying to use a variable, although I don't think you really are in this case.

--Jason

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.