Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Architect Loop action, iterate over each element in an array

    Posted 02-14-2022 13:38
    No replies, thread closed.
    Hi community,

    Question.

    I have a data action that returns, amongst other things, an array. But some of the elements in that array might be null values...

    example:
    "participants.name": [
        null,
        "Consultation Teamleaders",
        "Teamleaders"
      ],

    Now, How do I iterate over all the elements in such an array. I do not know it will contain 3 elements. It might be 2, it might be 10...AND the element can be NOT_SET.

    So I cannot decide to exit the loop with IsNotSetOrEmpty(array[i]) and there is no function to determine what the length of my array is, correct? There is no property on arrays AFAIK?

    Should I blame the data action developer and tell him to never return null values as element of the array? Oh wait, I'm that developer...
    #Ask Me Anything (AMA)
    #ArchitectureandDesign
    #Implementation
    #PlatformAdministration
    #Routing(ACD/IVR)
    #SystemAdministration
    #Unsure/Other

    ------------------------------
    Tommy Braes
    CX Consultant
    Proximus PLC
    tommy.braes.ext@proximus.com
    ------------------------------


  • 2.  RE: Architect Loop action, iterate over each element in an array

    Posted 02-14-2022 13:48
    No replies, thread closed.
    The Count function tells you how many items are in a collection

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



  • 3.  RE: Architect Loop action, iterate over each element in an array

    Posted 02-14-2022 13:57
    No replies, thread closed.
    No idea how I could miss that. I even used that before...

    thanks Melissa!

    ------------------------------
    Tommy Braes
    CX Consultant
    Proximus PLC
    tommy.braes.ext@proximus.com
    ------------------------------