Legacy Dev Forum Posts

 View Only

Sign Up

Servicenow data action to pull VIP status

  • 1.  Servicenow data action to pull VIP status

    Posted 06-05-2025 18:44

    david.ragon | 2023-10-12 06:00:50 UTC | #1

    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 mobilephone field", "type": "object", "required": [ "PHONENUMBER" ], "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": [ { "calendarintegration": "1", "lastlogintime": "", "failedattempts": "", "username": "EN10005891", "source": "", "title": "", "building": "", "sysclassname": "customercontact", "webserviceaccessonly": "false", "sysid": "dbb2f2f7870b3050a7eac9570cbb357c", "enablemultifactorauthn": "false", "sysupdatedby": "David.Ragon@Ethan.com.au", "internalintegrationuser": "false", "ssosource": "", "mobilephone": "+61451237863", "sysdomain": { "link": "https://ethantest.service-now.com/api/now/table/sysusergroup/global", "value": "global" }, "department": "", "utype": "", "vip": "true", "firstname": "David", "email": "David.Ragon@xyz.com", "introduction": "", "preferredlanguage": "en", "syscreatedby": "archit.b", "homephone": "", "timeformat": "", "manager": "", "sysmodcount": "4", "lastname": "Ragon", "avatar": "", "sysdomainpath": "/", "systags": "", "timezone": "", "schedule": "", "costcenter": "", "phone": "+61286045509", "name": "David Ragon", "employeenumber": "", "dateformat": "", "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!!!!


    Jason_Mathison | 2023-10-12 12:15:36 UTC | #2

    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


    system | 2023-11-12 12:16:34 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 22494