cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3742
Views
0
Helpful
9
Replies

Setting Prompt Directory path using a string variable?

So when you define a Prompt you get the form P[promptname.wav] and all is good.  What we want to do is have that prompt name be retrieved from a prompt directory which is defined by a string.   So assume all your prompts have the same numbers like 1001.wav but the actual file is customized based on things like Sales/1001.wav and Marketing/1001.wav   and you want to have a StringValue DirectoryName set the Directory to Sales or Marketing.   The Script does not seem to support setting P["DirectoryName"/1001.wav] where Directory Name is a string variable.    Is there a solution to this other than changing the entire prompt to a string type and dropping the P[] data type entirely?   

1 Accepted Solution

Accepted Solutions

Sam,

Once you've built your fully qualified prompt path and filename you can just assign your string variable to the prompt variable directly.  You don't need to encapsulate it with P[].  You'll find the UCCX editor will automatically ask you if it is a user prompt or system prompt if you use the "=" step.

Note: As of UCCX 8.0 all prompt names and directory names are case sensitive.

 

-Steven

Please help us make the communities better. Rate helpful posts!

View solution in original post

9 Replies 9

Samuel Womack
Level 5
Level 5

The way in which I normally do this is

final String PRMPT_DIR = "path/"

P[PRMPT_DIR + "1001.wav"]

Sam not quite sure this does it.  In your example the value PRMPT_DIR is a fixed value, that works.  The question has to do with the need to Change the value of PRMPT_DIR per call.  Based on which Trigger is called, we use that Trigger to index an Options file to retrieve the PROMPT_DIR value.  The thinking being that we us prompt numbers throughout the script but the come from different directories  so that departments can customize their prompts without having us create a separate script.  In your example we would want the value for path to change each time.

 

 

 

You are correct..make promptDir just a normal old String

Set that String however your logic works out for your groups...

if trigger == "Sales"

promptDir = "Sales/"

Use Parentheses

P[(prmptDir + "1001.wav")]

 

I am working with a similar issue.   It is simple enought to set the Prompt Directory but when it is a variable it seems to have different results.  The attached simple script is used to demonstrate Sam's recommendation.  The XML document is embedded in the script variable, so you dont need to create it.   So the script reaches into the XML document and pulls up the variable strDirectoryName and then adds "/" to it and then sets the strPromptDirectory.   I have done it three ways:  Hard coded, string value for prompt' and prompt data type resolved from string.  As you single step through the script you will find that all values populate appropriately, but only the hard coded play prompt actually plays the prompt.  The other two assemblies fail.  (Clearly it assumes the prompt 10001.wav is in the directory Generic/ if you want to try it).    Written in  Version 8.5 editor.  

Peter Buswell (aka DrVoIP)
http:/drvoip.com/blog

Sam,

Once you've built your fully qualified prompt path and filename you can just assign your string variable to the prompt variable directly.  You don't need to encapsulate it with P[].  You'll find the UCCX editor will automatically ask you if it is a user prompt or system prompt if you use the "=" step.

Note: As of UCCX 8.0 all prompt names and directory names are case sensitive.

 

-Steven

Please help us make the communities better. Rate helpful posts!

OK, I have rewritten the example case as you suggest and, no surprise, you are absolutely correct and it works.    I am unhappy however, to learn that I now have to administer my prompt names in two places! Ugly.  I have to specify the prompt data type and name it in the value/parameter fields and the do a bunch of set commands in the actual script?   Well at any rate, there is a lesson here for all of us and thank you Steven for your excellent contribution!

 

Peter Buswell (aka DrVoIP)
http:/drvoip.com/blog

Just use the (parentheses) if it don't look right(and if you want to define a prompt within a different type of Step and/or you are really doing the business with open curly braces and in that case the Set Step won't do anything for you as it does Auto Data Conversion..but doesn't do it if you open the brace)..the beauty of Software is you can do it many many ways..just remember to practice safe coding practices if you can help it..

:)

Sam - hopefully you are still around or hopefully someone else knows this answer.  I'm trying to use the parentheses inside the Prompt variable like Peter was doing with his example.  It is also not working for me so maybe we are doing this wrong or you were referring to something else.  I'm aware of the step that Stephen is saying to use as I've used it in the past.  However I would like to be able to see all my prompt numbers in an order in the variable list as opposed to being scattered all over the script.

CCX Editor Prompt Variable Error.jpg

Thanks,

Dan

Steven,

This is Essi from EB IT department. We are in need to update / rebuilt our UCCX scripts; are you infested in that project? Please let me know. seven o seven five two four- three three eight eight.