Legacy Dev Forum Posts

 View Only

Sign Up

Bypassing Null Values in Scheduled Callback Data Action

  • 1.  Bypassing Null Values in Scheduled Callback Data Action

    Posted 06-05-2025 18:46

    Aaron_Montanari | 2024-09-16 15:27:59 UTC | #1

    I am working on setting up a data action to Schedule a callback. Required fields: Queue ID, Number and Time.

    Optional - Script ID , Remote Name , Priority and ACD Skill.

    Testing with all fields filled out works.

    Errors pop up for each of the optional fields is left empty. Error - states: 7. Resolve request body template: Substitution values invalid in action config. Reference ${input.ACDSkill} evaluated to null when attempting to render at BodyTemplate[line 7, column 16] A common reason for this error is needing to prepend the variable with 'input.' or 'credentials.'

    {
      "queueId": "",
      "routingData": {
        "queueId": "${input.QueueID}",
        "skills": [
          {
            "id": "${input.ACDSkill}"
          }
        ],
        "priority": "${input.Priority}"
      },
      "callbackScheduledTime": "${input.DateTime}",
      "callbackNumbers": [
      "${input.PhoneNumber}"
      ],
      "name": "${input.RemoteName}"
      },
      "scriptId": "${input.Script}",
      
    }

    Works when everything has a value. Thanks Aaron


    Aaron_Montanari | 2024-09-16 15:28:12 UTC | #2

    recently - tried this also:

    {
      "routingData": {
        "queueId": "${input.QueueID}",
        #if(${input.ACDSkill})"skills": [{"id": "${input.ACDSkill}"],#end
        "priority": "${input.Priority}"
      },
      "callbackScheduledTime": "${input.DateTime}",
      "callbackNumbers": [
      "${input.PhoneNumber}"
      ],
    #if(${input.RemoteName})"RemoteName": "${input.RemoteName}",#end
    #if(${input.Script})"scriptId": "${input.Script}",#end
    • Unexpected end-of-input within/between Object entries at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 8, column: 1]

    Jason_Mathison | 2024-09-16 15:27:29 UTC | #3

    We use strict reference mode in our velocity template processing, so attempting to reference an unset variable would fail by default. However, you can use $!{input.foo} to not have an error if the variable is not set. In your example would something like "skills" : "" be valid, or should the skills key/value be removed completely?

    --Jason


    Jason_Mathison | 2024-09-16 15:41:01 UTC | #4

    I made a couple of tweaks to your second example to get it working.

    Added a missing } [{"id": "${input.ACDSkill}"] -> [{"id": "${input.ACDSkill}"}]

    Removed the trailing , here: ], and instead put commas at the front of the RemoteName and Script lines to make sure that the object doesn't have an invalid trailing comma.

    {
      "routingData": {
        "queueId": "${input.QueueID}",
        #if(${input.ACDSkill})"skills": [{"id": "${input.ACDSkill}"}],#end
        "priority": "${input.Priority}"
      },
      "callbackScheduledTime": "${input.DateTime}",
      "callbackNumbers": [
      "${input.PhoneNumber}"
      ]
    #if(${input.RemoteName}),"RemoteName": "${input.RemoteName}"#end
    #if(${input.Script}),"scriptId": "${input.Script}"#end
    }

    Aaron_Montanari | 2024-09-17 19:25:17 UTC | #5

    Awesome! Thank you!

    Testing this

    am I able to make the Priority and IF statement also?

    if("priority": "${input.Priority}")"priority": "${input.Priority}",#end

    Im also having trouble getting the callerIdname to display.

    i updated RemoteName to callerIdName -


    Jason_Mathison | 2024-09-18 00:17:43 UTC | #6

    The looks like the right idea for the priority if, but you would have to test it out to be sure.

    Where are you wanting the callerIdname to display?

    --Jason


    Aaron_Montanari | 2024-09-18 11:21:29 UTC | #7

    • Unexpected character ('}' (code 125)): was expecting double-quote to start field name at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 4, column: 9]

    if(${input.Priority})"priority:"${input.Priority}",#end - is what I added.

    For caller ID, looking to capture the remote column in interactions. what shows up in picture of caller. right now when i get a success it just says - no name provided.


    system | 2024-10-19 11:21:45 UTC | #8

    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: 28771