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
------------------------------
Original Message:
Sent: 09-24-2024 10:03
From: Amanpreet Singh
Subject: Using Regex to get specific State name in Email body
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
------------------------------