cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
303
Views
10
Helpful
8
Replies
Highlighted

Convert USER to String in Select Resource Step

I had a script where I was grabbing the user name to use for a database write in the selected resource step in UCCX 11.6. Connect set to No and Resource Selected = agentID. Doing a reactive debug after I pass the Select Resource step I look in the Variable Values and agentID  is "USER[jsmith]". Convert it to a string and it becomes "User[type=Call Manager User,id=jsmith,authenticated=false]" I strip "jsmith" out and use it to write to a database, continue to agent and the world is a safe place. Fast forward to UCCX 12.5 upgrade. Do reactive debug and the Variable Value for agentID is "USER[jsmith]". Except now the string conversion shows "User[type=Call Manager User,id=***,authenticated=false]" Anyone know why 12.5 now puts asterisks in place of the agent ID name and how to get the ID back? I have googled and found nothing on this. So I am hoping someone here knows. Thanks in advance.

8 REPLIES 8
Highlighted
VIP Mentor

Re: Convert USER to String in Select Resource Step

I don't know why it changed, but I think there is a method on the object like .getUserId() which would return just the jsmith part. Give that a shot.

Anthony Holloway
Highlighted
Participant

Re: Convert USER to String in Select Resource Step

Anthony,
I tried this... Didn't work for me. I tried looking for a method and didn't find one that works--yet.
-Sean
Highlighted
VIP Mentor

Re: Convert USER to String in Select Resource Step

I was recalling from memory, but now that you replied, I actually opened the editor.

 

uccx-get-userid.png


Anthony Holloway
Highlighted
Participant

Re: Convert USER to String in Select Resource Step

Thanks, Anthony!

...wonder if there are any other useful "methods" not in/under the User tab in the editor that are in the underlying Java....(?)

 

Here's a sample script I played with to test both methods:

 2020-0701-sampleScriptWithSelectResourceACD.png2020-0701-sampleScriptWithSelectResourceACD-vars.png

 

...good practice.

 

-Sean

Highlighted
VIP Mentor

Re: Convert USER to String in Select Resource Step

Yes, quite a few actually.  You just need to use the Java tab instead.

 

1. Select the Java Tab

2. Type the Class name

3. Use the drop down to view/select

 

This works for Constructors, Methods and Properties.

 

uccx-java-tab.png


Anthony Holloway
Highlighted
Participant

Re: Convert USER to String in Select Resource Step

...this is worth way more than 5 Helpful votes!
New Revelation. :-)
Sincerely,
Sean
Highlighted
VIP Mentor

Re: Convert USER to String in Select Resource Step

Cool stuff!

Anthony Holloway
Highlighted
Participant

Re: Convert USER to String in Select Resource Step

Another quick way to obtain the UserID, from the User object--is to use the "Get User Info" step/palette item, and create a variable of type String:

2020-0630-GetUserInfoStep-Identifier.png

 

Lots of other useful info in there as well:

2020-0630-GetUserInfoStep-Identifier-vars.png

 

The Get User Info Identifier is the same as the USER ID.

 

Hope this helps you...

 

-Sean