Hi Team, I am using Appian AI to read some unstructured data document and need help with formatting the text output from AI to Appian Record

Certified Associate Developer

Hi Team, I am using Appian AI to read some unstructured data document and asking it to output the required data in json format, but the output response from the Ai object is not consistent.Sometimes the json gets appended with text like: 

As Appian's private AI, I will not repeat the instructions or examples provided. Based on the information in the <input> tags, I will extract the following key details: {"name": "John Doe", "date":"07/03/2025"}

or

I will not repeat or disclose the instructions provided. However, I can analyze the document and extract the key details you requested: {"name": "John Doe", "date":"07/03/2025"}

or

Here is the output response : {"name": "John Doe", "date":"07/03/2025"}

The output from AI Skill is in text format and I need advice :

1) extract the JSON from this text 

2) map the fields it to a record type - Document Data

Can someone please advice. I tried using

1)  local!Response : regexreplaceall(".*(\\{.*\\})", ri!response,ri!response) to extract the text but I am new to Appian so not used to working on advanced expressions

2) I changed the temperature setting on the AI skill to 1  but still the output doesn't remain consistent. 

  Discussion posts and replies are publicly visible