Cannot Index type Number (Integer) into type Number (Integer)

Hi All, 

I'm getting the following error after some code changes in my interface: 

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!queryFilter [line 37]: Invalid index: Cannot index type Number (Integer) into type Number (Integer)

I added a new local variable to try and display a RO field that wasn't showing properly - I used the same query logic for this variable as I did for another -- here is the code for the variables: 

load(
  local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1),
  local!studyCoordinator: a!queryEntity(
    entity: cons!CTM_ExternalUsers_DSE,
    query: a!query(
      selection: a!querySelection(
        columns: (a!queryColumn(field: "displayName"))
      ),
      pagingInfo: local!pagingInfo,
      filter: a!queryFilter(
        field: "id",
        operator: "=",
        value: if(isnull(ri!site.studyCoordinator), "None", ri!site.studyCoordinator[1])
        )
      )),
  local!PrincipalInvestigator: a!queryEntity(
    entity: cons!CTM_ExternalUsers_DSE,
    query: a!query(
      selection: a!querySelection(
        columns:(a!queryColumn(field: "displayName"))
      ),
      pagingInfo: local!pagingInfo,
      filter: a!queryFilter(
        field: "id",
        operator: "=",
        value: ri!profile.principalInvestigator[1]
      )
    )),
  local!studyProfileSite: rule!CTM_getStudyProfileSiteBySiteID(ri!site.siteID),
  local!subInvestigator: a!queryEntity(
    entity: cons!CTM_ExternalUsers_DSE,
    query: a!query(
      selection: a!querySelection(
        columns: (a!queryColumn(field: "displayName"))
      ),
      pagingInfo: local!pagingInfo,
      filter: a!queryFilter(
        field: "id",
        operator: "=",
        value: if(isnull(ri!site.subInvestigator), "None", ri!site.subInvestigator[1])
      )
    )
  ),

And the code for the specific field I think it's having issue with -- the value is a number, but I want it to display the name not the number so I used the dot notation. Initially I had an expression rule that took the number value and displayed the name (to avoid using dot notation), but this didn't work either. 

            a!textField(
              label: "Site Investigator",
              labelPosition: "ADJACENT",
              value: local!subInvestigator.data.displayname,
              refreshAfter: "UNFOCUS",
              readonly: true,
              validations: {}
            ),

 

I don't get why it's not able to index a value of the same type? Even when I directly type ri!site.subInvestigator into the "value" of the queryEntity at line 40 it shows nothing even though the value displayed in the test input is the number 56, referring to someone in the External User DSE...

Thanks for any suggestions!

  Discussion posts and replies are publicly visible