Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Sort Collection

    Posted 11-22-2019 17:04
    No replies, thread closed.

    I have this odd problem where I dip into salesforce to lookup products offered to this number to dynamically build a phone tree (user prompt).  I am making great progress due to a lot of help on here.  I have a proof of concept almost working but I found this issue.

    Lets say my data retrieve pulls back these values

    Prod1 - 3
    Prod2 - 2
    Prod3 - 1

    In my IVR flow I check the items in this order
    If Prod1 is not not_set, then in a string collection (products) addItemAt "Prod1", toInt(taskProd1) -1

    Since "products" collection set doesn't have any other values, "Prod1" gets put at place 0

    next

    If Prod2 is not not_set, then in a string collection (products) addItemAt "Prod2", toInt(taskProd2) -1

    Now products is [Prod1, Prod2] because Prod 2 got put at slot 1

    I am thinking a way around this is to just add all items to a collection like [3Prod1, 2Prod2, 1Prod3] then sort it but not sure if I can do that, I don't see how to sort a collection.

    Can anyone think of a workaround?


    #Routing(ACD/IVR)

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


  • 2.  RE: Sort Collection
    Best Answer

    Posted 11-25-2019 09:45
    No replies, thread closed.

    Figured out a workaround, I was making an empty list before populating it with these values in "random" spots in the list.  I am now making a list filled with a word that I know will never go in my final list, 10 times.  "hello", "hello", "hello"....

    I then fill the list with my "real" values in the spots I get back from my salesforce data action.

    When that is done I just removeItem "hello" which removes all the placeholder values and leaves me with my final list in the right order.



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