Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Working with string collections in data action in architect.

    Posted 01-05-2024 14:23
    No replies, thread closed.

    Greetings.  I've created an inbound flow that builds a series of caller inputs (saved into variables) into a string variable.  It works fine as far as building the string, and when sent via a send SMS data action it succeeds.  However, I would like to change this to an agentless notification email.  The data action succeeds if I substitute the variable (Flow.AbsenceReport) with literal text, but I am stuck on how to send this content to the data action as a viable text body.  It's currently a space-delimited MakeList set of key:value pairs.  Is there a better way to accomplish this?


    #Integrations

    ------------------------------
    Vikki Papesh
    Sr. Genesys Cloud Developer II
    Tandem Diabetes Care, Inc.
    ------------------------------


  • 2.  RE: Working with string collections in data action in architect.

    Posted 01-05-2024 14:37
    No replies, thread closed.

    Olá Vikki,

    Can you see the position of this MakeList?

    I guess then if you use the position field you want, this is the solution, for example: Flow.AbsenceReport[0], Flow.AbsenceReport[1]...

    Att,



    ------------------------------
    Breno Canyggia Ferreira Marreco
    https://www.linkedin.com/in/brenocfm-40b62182/
    ------------------------------



  • 3.  RE: Working with string collections in data action in architect.

    Posted 01-05-2024 15:53
    No replies, thread closed.

    I want the entire MakeList result to be sent as the email body, not a single element.  This is where I am having the issue, as the agentless email data action element for text Body is not accepting the MakeList-ed data.  I'm not sure if I need to change something in the action config (content-type or form of the response body)?  It works fine if this text body field is populated with a string literal in the Architect Call Data Action, but not with this variable holding the body content.  It would be great if there was a library of examples that show a sample data action for each Genesys Cloud API, and an example Call Data Action on how to call the content.



    ------------------------------
    Vikki Papesh
    Sr. Genesys Cloud Developer II
    Tandem Diabetes Care, Inc.
    ------------------------------



  • 4.  RE: Working with string collections in data action in architect.
    Best Answer

    Posted 01-05-2024 20:03
    Edited by Cameron Tomlin 07-05-2024 09:53
    No replies, thread closed.

    I was finally able to work it out.  

    First, the SCIM data action retrieved exactly one result for each piece of data and compiled it into the string variable (no longer using MakeList), but using the suggestion from @Breno Canyggia Ferreira Marreco I was able to extract the contents of each element into an expression, then use text escape characters \n \n to create new lines (yes, it took 2 between each expression to format respectably).

    There is likely a more elegant way to accomplish this, and if you know one, I'd be happy to explore it.



    ------------------------------
    Vikki Papesh
    Sr. Genesys Cloud Developer II
    Tandem Diabetes Care, Inc.
    ------------------------------



  • 5.  RE: Working with string collections in data action in architect.

    Posted 01-06-2024 07:07
    No replies, thread closed.

    Excellent @Vikki Papesh. Congrats!!

    Att,



    ------------------------------
    Breno Canyggia Ferreira Marreco
    https://www.linkedin.com/in/brenocfm-40b62182/
    ------------------------------



  • 6.  RE: Working with string collections in data action in architect.

    Posted 01-08-2024 06:03
    No replies, thread closed.

    Have you tried to use ToString(<StringCollectionVarName>,<delimiter>) method? I think you need to use it like this ToString(Flow.AbsenceReport,"\n\n") is that what you need?

    __PRESENT__PRESENT



    ------------------------------
    Mostafa Awad
    ------------------------------



  • 7.  RE: Working with string collections in data action in architect.

    Posted 01-09-2024 01:11
    No replies, thread closed.

    Here's a bit more context.

    This is essentially like a voice survey questionnaire. 

    Callers (employees) enter a personal identifier number.

    Callers are presented with "press 1, press 2" Collect Input steps.  Each "Collect Input" sets a value to a variable.  

    Additional information about the user is added from a SCIM integration, which is an array of data, and is written to additional variables.  

    All the information gathered is then assembled into an email body, which is then sent on its merry way.

    With our SMS data action, I don't need to do anything to pull the data out of the array.  I just send it as space delimited strings to an SMS Message Body, send it, and it arrives nicely formatted.

    With a very similar Send Agentless Email data action, I have to extract the data using ArrayField[0] for the SCIM data, and force formatting between expressions when building the email body with \n or it is all one long, uninterrupted, hard to read string.

    I have it working well enough to use, but I would like to know if there is something I need to do with the request body or response body to extract the SCIM data, and to format it more elegantly without 21 lines of update statement when composing the title and 10 pieces of information into an email body in Architect.  It's formatted to look like key:value pairs for easy readability.



    ------------------------------
    Vikki Papesh
    Sr. Genesys Cloud Developer II
    Tandem Diabetes Care, Inc.
    ------------------------------