Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Using Regex to get specific State name in Email body

    Posted 09-24-2024 10:03
    No replies, thread closed.

    Good morning everyone,

    I am trying to use an API (/api/v2/conversations/emails/{conversationId}/messages/{messageId}) to get the Loss State from an email body. The email will have text like shown below:

    Job Address Information:

    Loss City: TAYLORSVILLE

    Loss State: NorthCarolina

    Loss Country: US

    Loss Zip Code:XXXXX-XXXX
    I want to get the State name and it can be the full name or just a short one like FL. I have the data action configured as follows: 

    I have tried various filters even something as simple as just matching "Loss" but I get the following error for it: 

    JSON failed output schema validation for the following reasons: Schema: # @/properties/MessageText.  Error location: /MessageText.  instance type (array) does not match any allowed primitive type (allowed: [\"string\"])",

    Could someone point out what needs to be done to extract that State name properly each time with varying length of State name?


    #API/Integrations

    ------------------------------
    Thanks,
    Amanpreet Singh
    TLS Connecting Voices
    ------------------------------


  • 2.  RE: Using Regex to get specific State name in Email body
    Best Answer

    Posted 09-24-2024 10:28
    No replies, thread closed.

    Hello Amanpreet, 

    This specific question would be better suited for the developer forums, as this has to do with requests for developing data actions.

    But taking a quick look at the data action code, it looks like it breaks down to a "bad string" issue. From the screen shot it looks like the "" are misplaced around \MessageText. But a post in the developer forums would be the best way to get an answer for this. 

    Cheers, 



    ------------------------------
    Cameron Tomlin
    Online Community Manager/Moderator
    Genesys - Employees
    ------------------------------



  • 3.  RE: Using Regex to get specific State name in Email body

    Posted 09-24-2024 10:33
    No replies, thread closed.

    Thank you Cameron, I have created an account in developer forums and will post there once approved.



    ------------------------------
    Amanpreet Singh
    TLS Connecting Voices
    ------------------------------