How do I give the field of a!querycolumn() when querying from datastore

I'm querying from a datastore, I only need one column, how do I give the column name in field

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    You have to give the CDT's field name in a!queryColumn. See the sample code for reference:

    a!queryEntity(
      entity: cons!DU_DOC_TYPE_DSE,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: "docTypeName"
            )
          }
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 50
        )
      ),
      fetchTotalCount: false
    )

Reply
  • 0
    Certified Associate Developer

    You have to give the CDT's field name in a!queryColumn. See the sample code for reference:

    a!queryEntity(
      entity: cons!DU_DOC_TYPE_DSE,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: "docTypeName"
            )
          }
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 50
        )
      ),
      fetchTotalCount: false
    )

Children
No Data