Bypassing Null Values in Scheduled Callback Data Action

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

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]

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

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
}

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 -

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

  • 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.

image

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