lehelg | 2021-10-27 20:48:02 UTC | #1
Looking at the scripter documentation (https://help.mypurecloud.com/articles/built-in-script-variables/), it appears that only the agent's full name is available, {{Scripter.Agent Name}}. Has anyone found a way to extract only the agent's first name?
Jerome.Saint-Marc | 2021-10-28 08:37:45 UTC | #2
Hello,
The first name and last name of a user are not saved in a Genesys Cloud user object. Only the full name is available. You can the schema of a user object in the Responses - 200 successful operation - Schema of the Get User API endpoint.
If there is a fixed/known separator between first name and last name, some logic to distinguish the first name from the rest of the full name, or if the first name is always a single word (I mean string without spaces), you could use a Dynamic variable in your Script. There are functions to manipulate a string. Otherwise, I don't think it is possible.
If first name is always the first word (no space in the first name), you could use something like this: slice({{Scripter.Agent Name}},0,indexOf({{Scripter.Agent Name}}, " "))
Regards,
system | 2021-11-28 08:38:05 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: 12488