Genesys Cloud - Developer Community

 View Only

Discussion Thread View
  • 1.  Parsing a Single String Containing Key-Value Pairs into a Collection

    Posted 03-19-2025 20:20

    Dear Team,

    I am currently encountering a challenge while utilizing an external API to pass the city ID. This is necessary in order to present our customers with various options for districts, as outlined in the attached API response.

    I am having difficulty providing customers with a collection of strings that they can choose from. Additionally, I need to map the customer's selection back to the corresponding key to pass it to the final API.

    Please refer to the attached document for more details regarding the API response.

    Thank you for your assistance.


    #DataActions

    ------------------------------
    Mohannad haddad
    ------------------------------


  • 2.  RE: Parsing a Single String Containing Key-Value Pairs into a Collection

    Posted 03-20-2025 09:27

    Hello,

    Is this data supposed to be used in Architect or somewhere else?

    Guessing from the output you'll need to split first on comma to get each "line" and then on semicolon to get UID and value.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 3.  RE: Parsing a Single String Containing Key-Value Pairs into a Collection

    Posted 03-20-2025 19:31

    yes I'm supposing to use in architect and I'm finding a difficulty to implement the mention logic, i would appreciate your support if you give me a hand



    ------------------------------
    Mohannad haddad
    ------------------------------



  • 4.  RE: Parsing a Single String Containing Key-Value Pairs into a Collection

    Posted 03-20-2025 19:47

    @Jan Heinonen

    please note that I did the splitting and I got the following (

    • 8b487a43-db62-ef11-a86f-000d3abaded5
      Al Ghaliz

    • c1c270a3-db62-ef11-a86f-000d3abaded5
      Al Badee

    • fc8be3b8-db62-ef11-a86f-000d3abaded5
      Al Basita

    • 51260cc0-db62-ef11-a86f-000d3abaded5
      Al Khalidiya

    • 2dfaebcd-db62-ef11-a86f-000d3abaded5
      Al Khush'a

    • c2cf7ddf-db62-ef11-a86f-000d3abaded5
      Al Rabwa

    • 9ac376e5-db62-ef11-a86f-000d3abaded5
      Al Rawda

    • 1b412af1-df62-ef11-a86f-000d3abaded5
      Al Zuhour

    • 99d361bb-e062-ef11-a86f-000d3abaded5
      Al Sadd

    • 686357c7-e062-ef11-a86f-000d3abaded5
      Al Salam

    • 24f64ad3-e062-ef11-a86f-000d3abaded5
      Al Shifa

    • 877babdf-e062-ef11-a86f-000d3abaded5
      Al Sahafa

    • 3ac6a9e5-e062-ef11-a86f-000d3abaded5
      Al Safa

    • cacbb1f1-e062-ef11-a86f-000d3abaded5
      Al Dhobab

    • 12bcc3fd-e062-ef11-a86f-000d3abaded5
      Al Ureen

    • f88cc809-e162-ef11-a86f-000d3abaded5
      Al Aziziyah

    • dfc5c50f-e162-ef11-a86f-000d3abaded5
      Al Quraiger

    • b70bbe21-e162-ef11-a86f-000d3abaded5
      Al Mashhad

    • 6a85b42d-e162-ef11-a86f-000d3abaded5
      Al Musayf

    My goal is to provide customer with district name as dynamic slot and once he picked the district name I have to mapped it to its ID in-order to send it to different API, How I could do this step ???



    ------------------------------
    Mohannad haddad
    ------------------------------



  • 5.  RE: Parsing a Single String Containing Key-Value Pairs into a Collection

    Posted 16 days ago

    Can you provide a text version of the response from the endpoint and what you want the output to look like?  Also, can you post an export of the data action you are working on so we can help out.

    Feel free to redact anything sensitive in the example data or data action, but please leave the "shape" of the data alone.



    ------------------------------
    --Jason
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources