Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Generate a GUID

    Posted 07-26-2024 07:00
    No replies, thread closed.

    Is there an easy way to generate a random GUID from within an Architect call or work flow? The conversation ID can be used as a valid GUID but the issue we have is that we need to run data actions to the customer's API and each request we seen requires a unique GUID. There are scenarios where multiple requests can be sent from the same call and therefor the conversation ID cannot be used for each request as the GUID no longer becomes unique.


    #ArchitectureandDesign

    ------------------------------
    James Foster
    Connect Managed Services (UK) Limited
    ------------------------------


  • 2.  RE: Generate a GUID

    Posted 07-26-2024 07:12
    Edited by Niel Vicente 07-26-2024 07:29
    No replies, thread closed.

    Hi James,

    Use the same conversationId then and store in a task/flow variable.

    Maintain another integer/numeric flow variable and concatenate to your conversationId before calling the API.

    Then, update your counter variable and add 1 after the data action.

    This ensures you concatenate a different number to your conversationId and make it unique. 

    Use this expression:
    Append(Left(Call.ConversationId,Length(Call.ConversationId) - Length(ToString(Task.count))),ToString(Task.count))

    Expression ensures that characters are removed from conversationId based on your counter's length to account for 2 or more digits.




    ------------------------------
    Niel Vicente
    DAMAC Properties Co. LLC
    ------------------------------



  • 3.  RE: Generate a GUID

    Posted 07-26-2024 07:27
    No replies, thread closed.

    Hi Niel,

    Thanks for this, I think that makes sense. Would you happen to have an example expression that could achieve this? I'm struggling to figure out how to remove a single character from the GUID/conversation ID.

    Regards,

    James



    ------------------------------
    James Foster
    Connect Managed Services (UK) Limited
    ------------------------------



  • 4.  RE: Generate a GUID
    Best Answer

    Posted 07-26-2024 07:32
    No replies, thread closed.

    Use this expression:


    Append(Left(Call.ConversationId,Length(Call.ConversationId) - Length(ToString(Flow.count))),ToString(Task.count))


    Replace Flow.count with whatever counter you create. Then place an update data after every data action to increase your integer.

    It must be a flow variable for global access.



    ------------------------------
    Niel Vicente
    DAMAC Properties Co. LLC
    ------------------------------