Genesys Cloud - Main

 View Only

Sign Up

Expand all | Collapse all

Dynamic Audio prompts based on data actions data

  Thread closed by the administrator, not accepting new replies.
  • 1.  Dynamic Audio prompts based on data actions data

    Posted 11-14-2019 12:51
    No replies, thread closed.

    I hope I can explain this in a way that makes sense.  I want to build a lot of logic in our Salesforce environment to help make our purecloud IVR a little more dynamic.  

    Right now I have a salesforce object that lists all of our phone numbers, those link to other things in salesforce for tracking purposes.

    One bit of data it pulls back is something like this:

    Product-A   Value is anything from 0-10
    Product-B   Value is anything from 0-10
    Product-C   Value is anything from 0-10

    Those product fields are all separate fields from an object in salesforce.  The idea behind those fields is to tell purecloud if we should prompt (>0) for those products and if so, what order (1-20).

    So lets say the lookup brings back this:

    Product-A = 0

    Product-B = 2

    Product-C = 1

    I want to look at those variables and form a dynamic IVR that says 

    For product C press 1

    For product B press 2

    (product a will never be mentioned)

    I was hoping it was possible with something like this

    https://help.mypurecloud.com/articles/work-with-dynamically-referenced-prompts/

    I am guessing bringing back each product as a value is complicating things. not sure how else I can bring it back.  

    I am going to keep digging around through functions and see what I can come up with.  If I figure something out, I will post back.


    #Integrations
    #Routing(ACD/IVR)

    ------------------------------
    Jeremy
    ------------------------------


  • 2.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-14-2019 13:31
    No replies, thread closed.
    Your data action can return integer values.  If for some reason you define the data action response fields as strings instead of integers, you can cast them to integers in the flow by using the ToInt expression.  Just make sure to check the response fields are not null first, by using the IsSet or IsNotSetOrEmpty expressions.

    ------------------------------
    Melissa Bailey
    Genesys - Employees
    ------------------------------



  • 3.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-14-2019 15:06
    No replies, thread closed.

    Yes I have the integration working and returning the values:

    "Imp__r.ProductA__c": 0,
    "Imp__r.ProductB__c": 1,
    "Impl__r.ProductC__c": 3,

    I just don't know how to take those 3 fields, evaluate if each is greater than 0 then of those that are, order them and build the dynamic prompts.

    Probably a lot to ask, if I could just see a similar example I think I can figure it out.



    ------------------------------
    Jeremy
    ------------------------------



  • 4.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-15-2019 08:59
    No replies, thread closed.
    Jeremy,

    This is possible if you deign your flow as a task instead of basic menu. Within the task what you need to do is to create a collection with your result set then you should process ever collection object to assemble an audio sequence step using expressions to play the menu dinamically. So in this case you have to use a loop starting at 0 to the index of the result set -1 to play the menu.

    We have designed and deployed a bunch of IVR's with this scenario.

    Regards,

    Mario

    ------------------------------
    Mario Sanchez
    Servicios en Tecnología de la Informacion SETEINFO del Ecuador C.A.
    ------------------------------



  • 5.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-15-2019 12:19
    No replies, thread closed.
    Do you happen to have a loop function and task that builds the ivr prompts example?  Screenshots and or formulas would be nice.  I think once I see one I can sort it out.  I feel like passing multiple fields/variables with values to loop through is a mistake but maybe not.

    ------------------------------
    Jeremy
    ------------------------------



  • 6.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-15-2019 14:07
    No replies, thread closed.
    Jeremy,

    Lete my ask that to my dev team and will share with you as soon as they can.

    Regards,

    Mario

    ------------------------------
    Mario Sanchez
    Servicios en Tecnología de la Informacion SETEINFO del Ecuador C.A.
    ------------------------------



  • 7.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-15-2019 17:00
    No replies, thread closed.

    I am making progress, slowly but surely, I want to put this out there in case what I am doing is going down the wrong path. 

    Example data integration return value:

    "Imp__r.ProductA__c": 2,
    "Imp__r.ProductB__c": 1,
    "Impl__r.ProductC__c": 3,

    I assign each one of those to a flow variable:

    Flow.ProductA - Flow.ProductC

    I have an Update Data function that adds each item to a string collection set list (seems dirty):

    Variable Name - Flow.PhoneTreeItemsString

    Expression:

    AddItemAt(AddItemAt(AddItemAt(MakeEmptyList(ToString(NOT_SET)),
    ToInt(Flow.ProductA )-1, "ProdA"),
    ToInt(Flow.ProductB )-1, "ProdB"),
    ToInt(Flow.ProductC )-1, "ProdC")

    I need to add null/0 checks to the items above to ensure they have a value before trying to add them.

    Right now I am ToAudioTTS ToString(Flow.PhoneTreeItemsString) to test if when I reorder the variables, they reorder in the collection set and it is working.

    The next bit I need to figure out is how to parse through that Flow.PhoneTreeItemsString collection and build out the dynamic audio prompts.  It sill go something like this (for the values above):

    Prompt(welcome audio, PhoneTreeItemsString[0], (press 1), PhoneTreeItemsString[1], (press 2), PhoneTreeItemsString[2], (press 3))

    Welcome, For ProductB press 1, For ProductA press2, For ProductC press 3.

    I will go fetch the recorded clips of "Welcome", "For ProductB" and "press n" based on name values if I am reading the documentation right.



    ------------------------------
    Jeremy
    ------------------------------



  • 8.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-15-2019 21:14
    No replies, thread closed.
    Jeremy,

    Almost there. What we usually do is inside the loop include a Collect Input where the input audio define the audio sequence using the collection array index.

    REgards,

    Mario

    ------------------------------
    Mario Sanchez
    Servicios en Tecnología de la Informacion SETEINFO del Ecuador C.A.
    ------------------------------



  • 9.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-20-2019 16:04
    No replies, thread closed.

    I am stuck.  I have figured out how to loop through my collection and find a userPrompt each time that finds something like this:

    FindUserPrompt("Press" + toString(Task.treeLoop + 1))

    What I don't understand is how to build a dynamic menu based on the loop.

    Essentially I want to have a welcome greeting then

    Loop:

    Add first item in my collection followed by press 1 (based on the number of the loop, then silence for 500ms) (allow for press 1 to take you to exit out)

    Add second item in my collection followed by press 2 (based on the number of the loop, then silence for 500ms)

    Add third item in my collection followed by press 3 (based on the number of the loop, then silence for 500ms)

    All of the above, I would look up the user prompts by name, example

    FindUserPrompt(Flow.PhoneTreeItemsString), FindUserPrompt("Press" + toString(Task.treeLoop + 1)), 500ms blank audio
    Repeat until the loop is done, which loops for every item in Flow.PhoneTreeItemsString

    When done the built up prompt would play:

    Welcome to my company, for product b press 1, for product a press 2, for product c press 3

    I feel like I am close, I am just struggling to figure out how to build out the menu tree.

    I was messing with something like this but couldn't figure it out.  I am going to keep trying:

    AudioPlaybackOptions(Append(FindUserPrompt("Press" + toString(Task.treeLoop + 1)), ToAudioBlank(500)), true)



    ------------------------------
    Jeremy
    ------------------------------



  • 10.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-20-2019 16:47
    No replies, thread closed.
    Jeremy,

    Please send me a direct email in order to schedule a zoom to help you solve the problem. My email is mario.sanchez@seteinfo.com

    Regards,

    Mario

    ------------------------------
    Mario Sanchez
    Servicios en Tecnología de la Informacion SETEINFO del Ecuador C.A.
    ------------------------------



  • 11.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-21-2019 13:48
    No replies, thread closed.

    Mario thanks for your help today, I am making progress.  One (more) thing I am struggling with is ensuring I am checking that a parameter has a value before I add it to collection. 

    How do I do an update data process that first checks if the variable has a value, if it does, then add a string to the value position:

    AddItemAt(AddItemAt(AddItemAt(MakeEmptyList(ToString(NOT_SET)),
    ToInt(Flow.ProductA )-1, "ProdA"),
    ToInt(Flow.ProductB )-1, "ProdB"),
    ToInt(Flow.ProductC )-1, "ProdC")

    I need to check each Flow.Productx has a value first.  

    I must not be good at reading the documentation around all of this I thought it would be simpler to do something like

    If(ISSet(Flow.ProductA),AddItemAt(Flow.Items, ToInt(Flow.ProductA)-1, "ProdA"), <do nothing>)



    ------------------------------
    Jeremy
    ------------------------------



  • 12.  RE: Dynamic Audio prompts based on data actions data

    Posted 11-21-2019 16:32
    No replies, thread closed.
    Jeremy,

    That validation we normally do within the Data Action we call to populate the collection. 

    regards,

    Mario

    ------------------------------
    Mario Sanchez
    Servicios en Tecnología de la Informacion SETEINFO del Ecuador C.A.
    ------------------------------