Nesting a!queryLogicalExpression and getting error "Expression evaluation error at function a!queryRecordType: Cannot apply a filter with a blank field name."

 Business Objective:

When Speakers apply to speak at one of our parishes, they supply documents to support their application to be a speaker.  Many of Speaker will apply to speak year after year.  There are three types of documents

  1. General Documents that are required and are valid for many years.  (For example their background check is valid for 5 years).
  2. Event Documents that are required for each event they are applying for. (For example the contract for the events).
  3. Optional Documents to support their application and are not required.  These could be general documents or documents for a specific event.

Required documents are customized for each of the Speakers.  For example, depending upon their country, there are different agencies that do background checks with their own forms and documents.

There are two areas (interfaces) where the documents are uploaded; the Speaker Interface (this is NOT a portal, as we give the speakers Appian login credentials) and the other is when they are applying for a specific event.

The speakers need to be able to assign those required documents and the optional documents when uploading the document in the appropriate interface.

Technical Setup:

I have a view in SQL that shows the Required Documents and the Optional Documents the speaker can upload.  I have a Record Type that points to the CDT. The fields are:

  • Rdt Index - integer a computed index
  • Speaker Id - Integer - This is 0 (zero) for the Optional Documents
  • Document Type ID - Integer 
  • Document Type - Text
  • Event Document - Boolean (true for an Event Document, false for General or Optional Document).

The Expression Rule for the General Documents needs to show the Required General Document types and the Optional Document Types.  My first attempt uses the a!queryLogicalExpression and works fine.

 a!queryLogicalExpression(
        ignoreFiltersWithEmptyValues: true,
        operator: "AND",
        filters: {
          a!queryFilter(
            field: 'recordType!PMSO VW Speaker Required DocTypes.fields.speakerId',
            operator: "=",
            value: ri!speakerId
          ),
          a!queryFilter(
            field: 'recordType!PMSO VW Speaker Required DocTypes.fields.eventDocument',
            operator: "=",
            value: false
          )
        }
      ),
  pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 50,
    sort: a!sortInfo(
      field: 'recordType!PMSO VW Speaker Required DocTypes.fields.sortOrder',
      ascending: true()

However, this just shows the General Required Documents and not the Optional Documents.  I tried to nest two queryLogicalExpressions withon one queryLogicalExpression the complete code is:

a!queryRecordType(
  recordType: 'recordType!PMSO VW Speaker Required DocTypes',
  fields: {
    'recordType!PMSO VW Speaker Required DocTypes.fields.speakerId',
    'recordType!PMSO VW Speaker Required DocTypes.fields.documentTypeId',
    'recordType!PMSO VW Speaker Required DocTypes.fields.documentType',
    'recordType!PMSO VW Speaker Required DocTypes.fields.eventDocument',
    'recordType!PMSO VW Speaker Required DocTypes.fields.sortOrder'
  },
  filters: a!queryLogicalExpression(
    ignoreFiltersWithEmptyValues: true,
    operator: "OR",
    filters: {
      a!queryLogicalExpression(
        operator: "AND",
        filters: {
          a!queryFilter(
            field: 'recordType!PMSO VW Speaker Required DocTypes.fields.speakerId',
            operator: "=",
            value: 0
          ),
          
        }
      ),
      a!queryLogicalExpression(
        ignoreFiltersWithEmptyValues: true,
        operator: "AND",
        filters: {
          a!queryFilter(
            field: 'recordType!PMSO VW Speaker Required DocTypes.fields.speakerId',
            operator: "=",
            value: ri!speakerId
          ),
          a!queryFilter(
            field: 'recordType!PMSO VW Speaker Required DocTypes.fields.eventDocument',
            operator: "=",
            value: false
          )
        }
      ),
      
    }
  ),
  pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 50,
    sort: a!sortInfo(
      field: 'recordType!PMSO VW Speaker Required DocTypes.fields.sortOrder',
      ascending: true()
    )
  )
).data
 

This is throwing an error.  

Expression evaluation error at function a!queryRecordType: Cannot apply a filter with a blank field name.

I checked the data and their are no nulls in the data. 

All of the fields seems to be referenced correctly.

Any help would be most appreciated!!

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data