I was debugging a script where I used a statement like this (where "cucm_user" is a user variable):
cucm_user = Get User("myUserName")
After running the commands above I see (in my debug) that cucm_user is set to "USER[myUserName]" by the Get User step. Next I tried changing my code by removing the Get User step and just declaring the cucm_user variable like this:
I found that skipping the Get User step and just directly declaring my user variable like this works fine (at least for the "Authenticate User Password" and "Upload Prompt" steps). Is there anything wrong with this approach? I understand why you'd need to use the Get User step if you were using a pin, but if you're using a username for authentication does the Get User step add any value?
Yes, you can do this. The Expression Language Reference Guide says as much on page 3-126.
You can replace the Get User and the Get User Info steps with one step by using a USER[userID] variable. Then, when a user is requested in the Get User Info step, instead of selecting a “generic” variable of type user, you can directly enter the specific user variable that holds the USER[userID] you want.