Skip to main content
scarg
June 5, 2024
Question

Using a record type where source is a database view into Records Chat Component

  • June 5, 2024
  • 2 replies
  • 0 views

Hi Everyone,

We have a way to use a Record type designed to have a database view as data source into a Records Chat Component?

local!data: a!queryRecordByIdentifier(
    recordType: 'MY RECORD WITH DATABASE VIEW AS SOURCE HERE',
    identifier: ri!id
),
a!recordsChatField(
  recordType: 'MY RECORD WITH DATABASE VIEW AS SOURCE HERE',
  identifier: ri!id,
  height: "TALL",
  initialMessage: concat(
    "For this instance of ",
    local!data['MY RECORD WITH DATABASE VIEW AS SOURCE HERE.fields.{processName}processName'],
    " process, I have the following data available: "
  ),
  suggestedQuestions: {
    concat(
      "When this instance was created?"
    ),
    concat(
      "What is the instance deadline?"
    ),
    concat(
      "What is the process version of ",
      local!data['MY RECORD WITH DATABASE VIEW AS SOURCE HERE.fields.{processName}processName'],
      " instance?"
    )
  },
  fields: {
    'MY RECORD WITH DATABASE VIEW AS SOURCE HERE.fields.{instanceId}instanceId',
    'MY RECORD WITH DATABASE VIEW AS SOURCE HERE.fields.{processVersion}processVersion',
    'MY RECORD WITH DATABASE VIEW AS SOURCE HERE.fields.{processCode}processCode'
  },
  relatedRecordData: {}
)

Using the code above, i'm getting the following chat message:

2 replies

lakshyas692780
July 17, 2025

I am trying to use this component but it displays an error message saying that the identifier passed is not same as the record identifier primary key.

stefanhelzle0001
July 17, 2025

OK. Did you check the data types?