Skip to main content
March 7, 2022
Question

How to index a multilines record type field out of a grid

  • March 7, 2022
  • 4 replies
  • 0 views

Hi,

I have RecordType based grid (the recordType is called "CJT_R_Vehicles").

The multiple grid selection is saved into a "selectedVehicles" local variable.

Then I need the selectedVehicles to be passed to an ER.

- What is the RI Type you would select in the ER to store the selection lines ?

   CJT_R_Vehicles

   CJT_R_Vehicles (array)

   RecordType

   RecordType (array)

- In the ER, how you would manipulate the RI (vehicle lines) ?

Let's say I need to index some fields, how would you do ?

I'm just curious because with this kind of type, we can not manipulate them with string fieldnames, without to be exposed to this error :

CJT_R_Vehicles must be indexed by its corresponding record type fields

4 replies

stefanhelzle0001
Brainy
March 7, 2022

Check this page in the documentation.

https://docs.appian.com/suite/help/22.1/reference-records.html#referencing-a-record-type

ri!records[recordType!CJT_R_Vehicles.fields.some_field]

March 7, 2022

Thanks Stefan for your reply.

I've already checked the documentation and tested this :

a!localVariables(
  local!ids: ri!recordVehicles['recordType!CJT_R_Vehicles.fields.id'],
  local!ids
)


but it returns null.

Maybe, my Test Input data is incorrect ?

a!recordData(
  recordType:'recordType!CJT_R_Vehicles',
  filters: a!queryLogicalExpression(
    operator: "AND",
    filters: {
      a!queryFilter(
        field: 'recordType!CJT_R_Vehicles.fields.deleted',
        operator: "=",
        value: false
      ),
    },
    ignoreFiltersWithEmptyValues: true
  )
),

stefanhelzle0001
Brainy
March 7, 2022

You should use a!queryRecordType() to fetch the data. It will return a datasubset with the ".data" attribute containing the list of records.

When you change this, it should work.