Why isn't there a default query record function like this following one in Appian which I made by myself

Description:

rule!OE_QueryOneRecordTypeByForeignKey(recordType, fkField, value)

Gets a record based on its foreign key field value

recordType (RecordType): queried record type

fkField (Record Field): foreign key field

value (Number (Integer)): integer value searched

a!localVariables(
  local!queryData: a!queryRecordType(
    recordType: ri!recordType,
    filters: {
      a!queryFilter(
        field: ri!fkField,
        operator: "=",
        value: ri!value,
        
      ),
      
    },
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1)
  ).data,
  if(
    a!isNotNullOrEmpty(local!queryData),
    local!queryData[1],
    null
  )
)

if it was OE_QueryRecordTypeByForeignKey, then you simply remove the [1] indexing

  Discussion posts and replies are publicly visible

Parents Reply Children