Can we pre-filled the timezone in Date/Time Component

Hello Team,

I'm building a custom script for customer where they can schedule a callback and attached skills to this callback. For Callbacks, the timezone need to be set.
But since their offices are all in France, they would like to avoid that extra click.
Can we pre-set the timezone using inbound attached data ?
I've tried several format for the attached data but it doesn't look like we can do it ...
The format for the outbound attached data, after filling the date/time component is as follow : 2019-12-31T13:59:00+0100

Cheers,
Valéry Chhoa

Valéry, when you say "custom script" do you mean an agent script in PureCloud?

If you know it, then you could certainly attach the caller's country or timezone as participant data to the conversation to be used in your script. However, I don't think there is anywhere where you can use that data to "pre-set the timezone". You'll have to have some code somewhere (Javascript on the client, or some service on a server) that would take the time entered by the agent and then factor in the timezone from the participant data.

As for the format of the callback time it is described here: https://developer.mypurecloud.com/api/rest/v2/conversations/creating-scheduled-callbacks.html

Please reply with more details, and possibly examples, if you have further questions.

Hello Jim,

Happy New Year !
And thanks for the answer.

Yes, I was talking about agent script in PureCloud. I add a date/time component with a participant data set (Input and Output)

The button is calling the data action below :

which is calling the API /api/v2/conversations/callbacks

In the callflow, I tried to preset the participant data like :
"ATTR_HeureRappel": "2019-12-23T14:35:12.744Z",
or
"ATTR_HeureRappel": "2019-12-23T14:42:20+0100",

But the field stay empty when the script show up to the agent.

From the documentation, https://help.mypurecloud.com/articles/date-input-script-component/, it state : When setting a callback time, the agent must select the contact’s time zone.

Are you saying that I should discard this note and just ask the agent to file the time and handle the timezone "manually" in Javascript on the client, or some service on a server, before calling the API ?

it's too bad that we can pre-filled any other text component but not the date/time one :frowning:

You must pass variables into the data action. It doesn't matter how they got set, but they have to be in the correct format.

For custom attributes, you must set them in the data property per the API documentation: POST /api/v2/conversations/callbacks.

Hello Tim,

I did some additional test. If I filled the date/time component without the timezone like that :
image

When I launch the Data Action, the variable ATTR_HeureRappel that is passed to the Data Action is empty and the callback can not be created.

And if I fill the timezone :
image
The variable ATTR_HeureRappel that is passed to the Data Action is correctly set and the Callback is created.

And since I'm unable to pre-set the timezone in the script ...

An alternative would be to ask the agent to filled the date / hour in a text field in the right format, but it's not user friendly ...

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