Genesys Cloud - Main

 View Only

Sign Up

  • 1.  Script Variable

    Posted an hour ago

    In a script trying to save to a second variable so when an interaction is transferred it saves the second value for reporting purposes.

    Have a drop down list box which populates a text box.

    Can see the two participant entries on answering the interaction and selecting from drop down box.

    On transfer both become null , tried a few things like creating a action not too repopulate if not null with no luck

    Some suggestions would be much appreciated 


    #Implementation

    ------------------------------
    Abdul Majeed
    Customer Solutions Design Specialist
    ------------------------------


  • 2.  RE: Script Variable

    Posted an hour ago

    Hi Abdul,

    I'm not sure I understood correctly: in your case, you set a value for a variable, but it wasn't saved as Participant Data? If so, is the script variable configured with Output enabled?



    ------------------------------
    Elisson Fernandes
    ------------------------------



  • 3.  RE: Script Variable

    Posted an hour ago

    Hi Elisson

    Both set to output I am expecting the first variable Emailcat not to be  set as participant data because of the transfer.

    The second variable Initialcat to keep the value set for example customer complaint select from drop down list box 



    ------------------------------
    Abdul Majeed
    Customer Solutions Design Specialist
    ------------------------------



  • 4.  RE: Script Variable

    Posted 54 minutes ago

    Hi Abdul,

    This is what I think is happening.

    Since both variables are set to Output, I'm wondering if the transferred Script session is reloading Initialcat as blank/null and then overwriting the existing Participant Data value.

    So for example:
    - Agent 1 selects Customer Complaint
    - Initialcat gets saved correctly
    - Transfer occurs
    - New Script instance loads with empty value
    - Empty value syncs back because Output is enabled

    Which would explain why Initialcat is not retaining the original dropdown value after transfer even though it was initially set correctly.

    Since Initialcat is intended to preserve the original reporting category, it may be worth testing whether that variable should only read the existing Participant Data value after transfer rather than continuing to output/update it.

    Hope this helps.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------



  • 5.  RE: Script Variable

    Posted an hour ago

    Hi Abdul,

    It sounds like the values are currently only being stored in local Script variables/text fields, which is why they become null after the interaction is transferred and the Script context reloads for the next agent.

    One approach that may help is storing the selected dropdown value into Participant Data instead of relying only on the Script variable itself.

    A common pattern is:

    Dropdown selection
    → Data Action/API call
    → Update Participant Data
    → Transfer interaction
    → Read Participant Data back into the Script if needed

    The API commonly used for this is:

    PATCH /api/v2/conversations/{conversationId}/participants/{participantId}/attributes

    Especially if the value is needed later for reporting, Participant Data tends to persist much better across transfers compared to local Script variables.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------



  • 6.  RE: Script Variable

    Posted 12 minutes ago

    That's a good point, @Phaneendra Avatapalli.

    I've done it to fix an issue with transfer interactions. In this way, we could identify values on participat data without overriding this. 

    This post helps us.


    Retrieve Scripts variable as Participant data in a subsequent call flow | Legacy Dev Forum Posts



    ------------------------------
    Arthur Pereira Reinoldes
    ------------------------------