Forum Discussion
arunnp
5 years agoNew Contributor II
Yes, want to prepare a formatted string by reading the particular field from all objects. The Jsonata expression we are currently using I pasted above.
The sample input
{
"chatHist": [{
"created_by": "Info Person",
"created_date": 1628581678201,
"information_type": "Request",
"text": "demo: I'm unable to create a new sale order",
"content": "",
"content_type": "Question"
},
{
"created_by": "Test",
"created_date": 1628581681109,
"information_type": "Response",
"text": "",
"content": [{
"abstract": "",
"link": "https://.service-now.com//kb_view.do?sys_kb_id=2ec8ccb5900b44dc8783d452773994d3",
"title": "Determine why Some People are Unable to Find or View a Web Page Saved on a File Server"
}],
"content_type": "srn"
},
{
"created_by": "Test",
"created_date": 1628581681967,
"information_type": "Response",
"text": "Please <a role=\"button\" tabindex=\"0\" class=\"create-ticket\"> click confirm <\/a> to create an incident for your query. If you do not wish to create an incident just ask any other question.",
"content": "",
"content_type": "text"
}
]
}
After formatting this the string will be
Virtual assistant chat history:
Info Person:demo: I'm unable to create a new sale order
VA: Please click confirm to create an incident for your query. If you do not wish to create an incident just ask any other question.
here we are adding ‘Virtual assistant chat history:’ as heading of the string.
VA.-> replacement for the “created_by”: “Test”. field value.
I hope I gave details.
thanks
arun